From 3896a661227476c5111e4ea681c1d9ef2d2db13f Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 16 May 2015 08:09:15 +0200 Subject: [PATCH] Fixed tests. --- tests/controllers/ReportControllerTest.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/controllers/ReportControllerTest.php b/tests/controllers/ReportControllerTest.php index 1af2811b94..ad71e67aed 100644 --- a/tests/controllers/ReportControllerTest.php +++ b/tests/controllers/ReportControllerTest.php @@ -192,18 +192,19 @@ class ReportControllerTest extends TestCase $query = $this->mock('FireflyIII\Helpers\Report\ReportQueryInterface'); - $helper->shouldReceive('yearBalanceReport')->withAnyArgs()->andReturn([]); - $query->shouldReceive('getAllAccounts')->withAnyArgs()->andReturn(new Collection([$account])); + $helper->shouldReceive('yearBalanceReport')->once()->withAnyArgs()->andReturn([]); + $query->shouldReceive('getAllAccounts')->once()->withAnyArgs()->andReturn(new Collection([$account])); - $query->shouldReceive('incomeInPeriod')->withAnyArgs()->andReturn(new Collection([$journal, $journal])); - $query->shouldReceive('journalsByRevenueAccount')->withAnyArgs()->andReturn($journals); - $query->shouldReceive('journalsByExpenseAccount')->withAnyArgs()->andReturn($journals); + $query->shouldReceive('incomeInPeriod')->once()->withAnyArgs()->andReturn(new Collection([$journal, $journal])); + $query->shouldReceive('expenseInPeriod')->once()->withAnyArgs()->andReturn(new Collection([$journal, $journal])); + $query->shouldReceive('journalsByRevenueAccount')->once()->withAnyArgs()->andReturn($journals); + $query->shouldReceive('journalsByExpenseAccount')->once()->withAnyArgs()->andReturn($journals); // mock stuff! Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency); Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]); - Amount::shouldReceive('getCurrencyCode')->andReturn('X'); - Amount::shouldReceive('getCurrencySymbol')->andReturn('X'); + Amount::shouldReceive('getCurrencyCode')->once()->andReturn('X'); + Amount::shouldReceive('getCurrencySymbol')->once()->andReturn('X'); Amount::shouldReceive('format')->andReturn('X'); $this->call('GET', '/reports/2015/shared');