Improve test coverage.

This commit is contained in:
James Cole
2019-07-24 19:02:41 +02:00
parent 226e2f7185
commit ee95606ec0
39 changed files with 378 additions and 234 deletions

View File

@@ -26,6 +26,7 @@ use Carbon\Carbon;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use Log;
use Preferences;
use Tests\TestCase;
/**
@@ -65,6 +66,8 @@ class OperationsControllerTest extends TestCase
$tasker = $this->mock(AccountTaskerInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$tasker->shouldReceive('getExpenseReport')->andReturn($return);
@@ -83,6 +86,8 @@ class OperationsControllerTest extends TestCase
$tasker = $this->mock(AccountTaskerInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$tasker->shouldReceive('getIncomeReport')->andReturn([]);
@@ -111,6 +116,8 @@ class OperationsControllerTest extends TestCase
$tasker = $this->mock(AccountTaskerInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$tasker->shouldReceive('getExpenseReport')->andReturn($return);