Fix tests for show() routines.

This commit is contained in:
James Cole 2017-07-30 13:57:46 +02:00
parent 1cfa1faccc
commit 05aace84e1
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 40 additions and 40 deletions

View File

@ -371,19 +371,19 @@ class CategoryControllerTest extends TestCase
$accountRepos->shouldReceive('getAccountsByType')->once()->andReturn(new Collection);
$collector = $this->mock(JournalCollectorInterface::class);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(4);
$collector->shouldReceive('setRange')->andReturnSelf()->times(4);
$collector->shouldReceive('setPage')->andReturnSelf()->once();
$collector->shouldReceive('setLimit')->andReturnSelf()->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->twice();
$collector->shouldReceive('setRange')->andReturnSelf()->twice();
$collector->shouldReceive('setTypes')->andReturnSelf()->times(1);
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf()->times(4);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(4);
$collector->shouldReceive('setCategory')->andReturnSelf()->times(4);
$collector->shouldReceive('removeFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf()->twice();
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->once();
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->twice();
$collector->shouldReceive('setCategory')->andReturnSelf()->twice();
$collector->shouldReceive('getJournals')->andReturn(new Collection)->times(1);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
$this->be($this->user());
$this->changeDateRange($this->user(), $range);

View File

@ -130,17 +130,17 @@ class TagControllerTest extends TestCase
$repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once();
$repository->shouldReceive('earnedInPeriod')->andReturn('1')->once();
$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);
$collector->shouldReceive('removeFilter')->andReturnSelf()->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setTag')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(3);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('setRange')->andReturnSelf()->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
$collector->shouldReceive('setLimit')->andReturnSelf()->once();
$collector->shouldReceive('setPage')->andReturnSelf()->once();
$collector->shouldReceive('setTag')->andReturnSelf()->once();
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->once();
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->once();
$collector->shouldReceive('setRange')->andReturnSelf()->once();
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
$this->be($this->user());
@ -161,17 +161,17 @@ class TagControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();
$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);
$collector->shouldReceive('removeFilter')->andReturnSelf()->once();
$repository->shouldReceive('sumOfTag')->andReturn('1')->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setTag')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(3);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('setRange')->andReturnSelf()->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
$collector->shouldReceive('setLimit')->andReturnSelf()->once();
$collector->shouldReceive('setPage')->andReturnSelf()->once();
$collector->shouldReceive('setTag')->andReturnSelf()->once();
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->once();
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->once();
$collector->shouldReceive('setRange')->andReturnSelf()->once();
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
$this->be($this->user());
@ -196,16 +196,16 @@ class TagControllerTest extends TestCase
$repository->shouldReceive('earnedInPeriod')->andReturn('1')->once();
$repository->shouldReceive('sumOfTag')->andReturn('1')->once();
$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setTag')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(3);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('setRange')->andReturnSelf()->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$collector->shouldReceive('removeFilter')->andReturnSelf()->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
$collector->shouldReceive('setLimit')->andReturnSelf()->once();
$collector->shouldReceive('setPage')->andReturnSelf()->once();
$collector->shouldReceive('setTag')->andReturnSelf()->once();
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->once();
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->once();
$collector->shouldReceive('setRange')->andReturnSelf()->once();
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
$this->be($this->user());