mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 22:58:09 +00:00
Fix test coverage.
This commit is contained in:
@@ -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']));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user