Fix test coverage.

This commit is contained in:
James Cole
2019-08-17 12:08:09 +02:00
parent 1d4434698e
commit b53cbbe469
16 changed files with 83 additions and 213 deletions

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace Tests\Feature\Controllers\Report;
use Carbon\Carbon;
use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Helpers\Report\BalanceReportHelperInterface;
use Log;
@@ -62,7 +61,7 @@ class BalanceControllerTest extends TestCase
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$balance->shouldReceive('getBalanceReport')->andReturn(new Balance);
$balance->shouldReceive('getBalanceReport')->andReturn([]);
$this->be($this->user());
$response = $this->get(route('report-data.balance.general', ['1', '20120101', '20120131']));

View File

@@ -63,7 +63,7 @@ class BudgetControllerTest extends TestCase
$date = new Carbon;
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
//Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$helper->shouldReceive('getBudgetReport')->andReturn($return);

View File

@@ -112,11 +112,12 @@ class CategoryControllerTest extends TestCase
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
//Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$repository->shouldReceive('getCategories')->andReturn(new Collection([$category]));
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
$repository->shouldReceive('earnedInPeriod')->andReturn('1');
$repository->shouldReceive('spentInPeriod')->andReturn([]);
$repository->shouldReceive('earnedInPeriod')->andReturn([]);
$this->be($this->user());

View File

@@ -55,7 +55,7 @@ class OperationsControllerTest extends TestCase
{
$this->mockDefaultSession();
$return = [
1 => [
1 => [
'id' => 1,
'name' => 'Some name',
'sum' => '5',
@@ -104,6 +104,7 @@ class OperationsControllerTest extends TestCase
{
$this->mockDefaultSession();
$return = [
'sums' => [],
1 => [
'id' => 1,
'name' => 'Some name',