From 9d142aa8b0dab1fbe163abc725f23f5d820e1ca6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 21 Jul 2014 17:31:41 +0200 Subject: [PATCH] Fixed tests. --- app/tests/controllers/ChartControllerTest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/tests/controllers/ChartControllerTest.php b/app/tests/controllers/ChartControllerTest.php index ca59ba39dc..186d298dda 100644 --- a/app/tests/controllers/ChartControllerTest.php +++ b/app/tests/controllers/ChartControllerTest.php @@ -89,6 +89,9 @@ class ChartControllerTest extends TestCase $start = new \Carbon\Carbon; $end = new \Carbon\Carbon; + // mock preferences & pref: + $pref = $this->mock('Preference'); + $pref->shouldReceive('getAttribute', 'data')->andReturn([]); // mock toolkit @@ -96,8 +99,8 @@ class ChartControllerTest extends TestCase $toolkit->shouldReceive('getDateRange')->andReturn([$start, $end]); // // // mock preference? -// $preferences = $this->mock('Firefly\Helper\Preferences\PreferencesHelperInterface'); -// $preferences->shouldReceive('get')->with('viewRange', '1M')->once()->andReturn($pref); + $preferences = $this->mock('Firefly\Helper\Preferences\PreferencesHelperInterface'); + $preferences->shouldReceive('get')->with('viewRange', '1M')->once()->andReturn($pref); // // // // mock toolkit: @@ -111,7 +114,6 @@ class ChartControllerTest extends TestCase //// - // call $this->call('GET', '/chart/home/categories');