Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Tag controller tests.
James Coled8addc3175d6
diff --git a/tests/Feature/Controllers/TagControllerTest.php b/tests/Feature/Controllers/TagControllerTest.phpindex f9a0d3848a..7c96c76982 100644--- a/tests/Feature/Controllers/TagControllerTest.php+++ b/tests/Feature/Controllers/TagControllerTest.php@@ -31,6 +31,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;use FireflyIII\Repositories\Tag\TagRepositoryInterface;use FireflyIII\Repositories\User\UserRepositoryInterface;use Illuminate\Pagination\LengthAwarePaginator;+use Illuminate\Support\Collection;use Log;use Mockery;use Tests\TestCase;@@ -173,12 +174,14 @@ class TagControllerTest extends TestCase$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);- $repository->shouldReceive('spentInPeriod')->andReturn('-1')->times(1);+$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();- $repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once();- $repository->shouldReceive('earnedInPeriod')->andReturn('1')->times(1);$repository->shouldReceive('sumsOfTag')->andReturn($amounts)->once();+ $repository->shouldReceive('expenseInPeriod')->andReturn(new Collection)->atLeast()->times(1);+ $repository->shouldReceive('incomeInPeriod')->andReturn(new Collection)->atLeast()->times(1);+ $repository->shouldReceive('transferredInPeriod')->andReturn(new Collection)->atLeast()->times(1);+$collector->shouldReceive('removeFilter')->andReturnSelf()->once();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();$collector->shouldReceive('setLimit')->andReturnSelf()->once();@@ -248,10 +251,12 @@ class TagControllerTest extends TestCase$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);- $repository->shouldReceive('spentInPeriod')->andReturn('-1')->times(1);$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();- $repository->shouldReceive('lastUseDate')->andReturn(new Carbon)->once();- $repository->shouldReceive('earnedInPeriod')->andReturn('1')->times(1);++ $repository->shouldReceive('expenseInPeriod')->andReturn(new Collection)->atLeast()->times(1);+ $repository->shouldReceive('incomeInPeriod')->andReturn(new Collection)->atLeast()->times(1);+ $repository->shouldReceive('transferredInPeriod')->andReturn(new Collection)->atLeast()->times(1);+$collector->shouldReceive('removeFilter')->andReturnSelf()->once();$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();