From b6227e633cdb01fe9a9a11d67ea583216a801bf6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 27 Aug 2017 11:07:14 +0200 Subject: [PATCH] Fix tests --- tests/Feature/Controllers/BudgetControllerTest.php | 6 +++--- tests/Feature/Controllers/TagControllerTest.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/Feature/Controllers/BudgetControllerTest.php b/tests/Feature/Controllers/BudgetControllerTest.php index 06aa91b33d..24bb163aed 100644 --- a/tests/Feature/Controllers/BudgetControllerTest.php +++ b/tests/Feature/Controllers/BudgetControllerTest.php @@ -44,7 +44,7 @@ class BudgetControllerTest extends TestCase $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); $repository->shouldReceive('updateLimitAmount')->andReturn(new BudgetLimit); - $data = ['amount' => 200,]; + $data = ['amount' => 200, 'start' => '2017-01-01', 'end' => '2017-01-31']; $this->be($this->user()); $response = $this->post(route('budgets.amount', [1]), $data); $response->assertStatus(200); @@ -61,7 +61,7 @@ class BudgetControllerTest extends TestCase $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); $repository->shouldReceive('updateLimitAmount')->andReturn(new BudgetLimit); - $data = ['amount' => 0,]; + $data = ['amount' => 0, 'start' => '2017-01-01', 'end' => '2017-01-31']; $this->be($this->user()); $response = $this->post(route('budgets.amount', [1]), $data); $response->assertStatus(200); @@ -542,7 +542,7 @@ class BudgetControllerTest extends TestCase $repository->shouldReceive('getAvailableBudget')->andReturn('1'); $repository->shouldReceive('cleanupBudgets'); - $response = $this->get(route('budgets.income', [1])); + $response = $this->get(route('budgets.income', ['2017-01-01', '2017-01-31'])); $response->assertStatus(200); } diff --git a/tests/Feature/Controllers/TagControllerTest.php b/tests/Feature/Controllers/TagControllerTest.php index 7e1c5c8e76..4846cd6136 100644 --- a/tests/Feature/Controllers/TagControllerTest.php +++ b/tests/Feature/Controllers/TagControllerTest.php @@ -129,6 +129,9 @@ class TagControllerTest extends TestCase $repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once(); $repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once(); $repository->shouldReceive('earnedInPeriod')->andReturn('1')->once(); + $repository->shouldReceive('sumOfTag')->andReturn('1')->once(); + $repository->shouldReceive('resultOfTag')->andReturn('1')->once(); + $collector->shouldReceive('removeFilter')->andReturnSelf()->once(); @@ -161,6 +164,8 @@ class TagControllerTest extends TestCase $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); $repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once(); + $repository->shouldReceive('resultOfTag')->andReturn('1')->once(); + $collector->shouldReceive('removeFilter')->andReturnSelf()->once(); $repository->shouldReceive('sumOfTag')->andReturn('1')->once(); $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once(); @@ -195,6 +200,7 @@ class TagControllerTest extends TestCase $repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once(); $repository->shouldReceive('earnedInPeriod')->andReturn('1')->once(); $repository->shouldReceive('sumOfTag')->andReturn('1')->once(); + $repository->shouldReceive('resultOfTag')->andReturn('1')->once(); $collector->shouldReceive('removeFilter')->andReturnSelf()->once(); $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();