Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
More tests!
James Cole74c9feb53f04
diff --git a/app/models/User.php b/app/models/User.phpindex 6984098fa6..810ac6c25c 100644--- a/app/models/User.php+++ b/app/models/User.php@@ -98,12 +98,5 @@ class User extends Eloquent implements UserInterface, RemindableInterfacereturn $this->hasMany('TransactionJournal');}- /**- * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough- */- public function transactions()- {- return $this->hasManyThrough('TransactionJournal', 'Transaction');- }}\ No newline at end of filediff --git a/app/tests/factories/Preference.php b/app/tests/factories/Preference.phpnew file mode 100644index 0000000000..89a26f5812--- /dev/null+++ b/app/tests/factories/Preference.php@@ -0,0 +1,9 @@+<?php++League\FactoryMuffin\Facade::define(+ 'Preference', [+ 'user_id' => 'factory|User',+ 'name' => 'word',+ 'data' => 'sentence',+ ]+);diff --git a/app/tests/factories/TransactionCurrency.php b/app/tests/factories/TransactionCurrency.phpindex cad7372767..cfb3b685b0 100644--- a/app/tests/factories/TransactionCurrency.php+++ b/app/tests/factories/TransactionCurrency.php@@ -10,7 +10,21 @@ League\FactoryMuffin\Facade::define(return $code;},- 'name' => 'word',- 'symbol' => '$'+ 'name' => function () {+ $code = '';+ for ($i = 0; $i < 8; $i++) {+ $code .= chr(rand(65, 90));+ }++ return $code;+ },+ 'symbol' => function () {+ $code = '';+ for ($i = 0; $i < 2; $i++) {+ $code .= chr(rand(65, 90));+ }++ return $code;+ }]);diff --git a/tests/unit/TransactionTypeTest.php b/tests/unit/TransactionTypeTest.phpnew file mode 100644index 0000000000..c0feba77b5--- /dev/null+++ b/tests/unit/TransactionTypeTest.php@@ -0,0 +1,30 @@+<?php+use League\FactoryMuffin\Facade as f;++/**+ * Class TransactionTypeTest+ */+class TransactionTypeTest extends TestCase+{++ public function setUp()+ {+ parent::setUp();+ }++ public function tearDown()+ {+ parent::tearDown();+ }++ // tests++ public function testJournals()+ {+ $journal = f::create('TransactionJournal');+ $type = $journal->transactionType;+ $this->assertCount(1, $type->transactionJournals()->get());+ }+++}\ No newline at end of filediff --git a/tests/unit/UserTest.php b/tests/unit/UserTest.phpnew file mode 100644index 0000000000..86ad425bd6--- /dev/null+++ b/tests/unit/UserTest.php@@ -0,0 +1,34 @@+<?php+use League\FactoryMuffin\Facade as f;++/**+ * Class AccountTest+ */+class UserTest extends TestCase+{++ public function setUp()+ {+ parent::setUp();+ }++ public function tearDown()+ {+ parent::tearDown();+ }++ // tests++ public function testPreference()+ {+ $pref = f::create('Preference');+ $this->assertEquals($pref->user_id, $pref->user->id);+ }++ public function testReminder()+ {+ $reminder = f::create('Reminder');+ $this->assertEquals($reminder->user_id, $reminder->user->id);+ }++}\ No newline at end of file