Fix tests

This commit is contained in:
James Cole 2017-08-27 11:07:14 +02:00
parent 1319cb2e4e
commit b6227e633c
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 9 additions and 3 deletions

View File

@ -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);
}

View File

@ -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();