From ee5c534ca3686aa947f06361b062d5445140dea3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 30 Apr 2015 17:32:00 +0200 Subject: [PATCH] Took the time to fix the tests. --- tests/controllers/PiggyBankControllerTest.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/controllers/PiggyBankControllerTest.php b/tests/controllers/PiggyBankControllerTest.php index 63964eb163..fe49823479 100644 --- a/tests/controllers/PiggyBankControllerTest.php +++ b/tests/controllers/PiggyBankControllerTest.php @@ -93,8 +93,7 @@ class PiggyBankControllerTest extends TestCase public function testDestroy() { $piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank'); - $user = FactoryMuffin::create('FireflyIII\User'); - $this->be($user); + $this->be($piggyBank->account->user); $repository = $this->mock('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface'); $repository->shouldReceive('destroy')->once()->withAnyArgs()->andReturn(true); @@ -109,8 +108,7 @@ class PiggyBankControllerTest extends TestCase public function testEdit() { $piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank'); - $user = FactoryMuffin::create('FireflyIII\User'); - $this->be($user); + $this->be($piggyBank->account->user); $account = FactoryMuffin::create('FireflyIII\Models\Account'); $collection = new Collection([$account]); @@ -135,8 +133,7 @@ class PiggyBankControllerTest extends TestCase public function testEditNullDate() { $piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank'); - $user = FactoryMuffin::create('FireflyIII\User'); - $this->be($user); + $this->be($piggyBank->account->user); $piggyBank->targetdate = null; $piggyBank->save(); $account = FactoryMuffin::create('FireflyIII\Models\Account');