Fix tests

This commit is contained in:
James Cole
2019-09-06 17:19:21 +02:00
parent e9782a701f
commit 30f454d38a
12 changed files with 212 additions and 132 deletions

View File

@@ -24,6 +24,8 @@ namespace Tests\Feature\Controllers\Report;
use Carbon\Carbon;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Support\Collection;
use Log;
use Preferences;
use Tests\TestCase;
@@ -54,9 +56,12 @@ class BalanceControllerTest extends TestCase
{
$this->mockDefaultSession();
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$repository = $this->mock(BudgetRepositoryInterface::class);
$date = new Carbon;
$budget = $this->getRandomBudget();
$repository->shouldReceive('getBudgets')->atLeast()->once()->andReturn(new Collection([$budget]));
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);