mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Update code, work to pass filters. [skip ci]
This commit is contained in:
@@ -89,18 +89,26 @@ class ChartControllerTest extends TestCase
|
||||
$start = new \Carbon\Carbon;
|
||||
$end = new \Carbon\Carbon;
|
||||
|
||||
|
||||
|
||||
// mock toolkit
|
||||
$toolkit = $this->mock('Firefly\Helper\Toolkit\ToolkitInterface');
|
||||
$toolkit->shouldReceive('getDateRange')->andReturn(null);
|
||||
|
||||
// mock toolkit:
|
||||
// $class = $this->getMockClass('Foo', array('baz'));
|
||||
// $toolkit = $this->mock('Firefly\Helper\Toolkit\ToolkitInterface');
|
||||
// $toolkit::static ->shouldReceive('getDateRange')->once()->andReturn([$start, $end]);
|
||||
|
||||
// // mock transaction journal
|
||||
// $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface');
|
||||
// $tj->shouldReceive('getByDateRange')->with($start, $end)->andReturn([]);
|
||||
$toolkit->shouldReceive('getDateRange')->andReturn([$start, $end]);
|
||||
//
|
||||
// // mock preference?
|
||||
// $preferences = $this->mock('Firefly\Helper\Preferences\PreferencesHelperInterface');
|
||||
// $preferences->shouldReceive('get')->with('viewRange', '1M')->once()->andReturn($pref);
|
||||
//
|
||||
//
|
||||
// // mock toolkit:
|
||||
//// $class = $this->getMockClass('Foo', array('baz'));
|
||||
//// $toolkit = $this->mock('Firefly\Helper\Toolkit\ToolkitInterface');
|
||||
//// $toolkit::static ->shouldReceive('getDateRange')->once()->andReturn([$start, $end]);
|
||||
//
|
||||
//// // mock transaction journal
|
||||
//// $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface');
|
||||
//// $tj->shouldReceive('getByDateRange')->with($start, $end)->andReturn([]);
|
||||
////
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,12 +13,25 @@ class HomeControllerTest extends TestCase
|
||||
View::shouldReceive('share');
|
||||
View::shouldReceive('make')->with('index')->once()->andReturn(\Mockery::self())
|
||||
->shouldReceive('with')->once() // Pass a 'with' parameter
|
||||
->with('count', 0);
|
||||
->with('count', 0)->andReturn(\Mockery::self())
|
||||
->shouldReceive('with')->once() // Pass a 'with' parameter
|
||||
->with('transactions', [])->andReturn(\Mockery::self());
|
||||
|
||||
// pass another
|
||||
Auth::shouldReceive('check')->andReturn(true);
|
||||
|
||||
|
||||
// mock account repository
|
||||
$accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface');
|
||||
$accounts->shouldReceive('count')->andReturn(0);
|
||||
$accounts->shouldReceive('getActiveDefault')->andReturn([]);
|
||||
|
||||
// mock preferences & pref:
|
||||
$pref = $this->mock('Preference');
|
||||
$pref->shouldReceive('getAttribute', 'data')->andReturn([]);
|
||||
|
||||
$preferences = $this->mock('Firefly\Helper\Preferences\PreferencesHelperInterface');
|
||||
$preferences->shouldReceive('get')->with('frontpageAccounts', [])->once()->andReturn($pref);
|
||||
|
||||
// call
|
||||
$this->call('GET', '/');
|
||||
|
||||
Reference in New Issue
Block a user