mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-21 03:39:00 +00:00
Made big headway in preference management, accounts, importing stuff, etc. etc.
This commit is contained in:
@@ -10,13 +10,25 @@ class HomeControllerTest extends TestCase
|
||||
public function testIndex()
|
||||
{
|
||||
// mock:
|
||||
View::shouldReceive('share');
|
||||
View::shouldReceive('make')->with('index')->once()->andReturn(\Mockery::self())
|
||||
->shouldReceive('with')->once() // Pass a 'with' parameter
|
||||
->with('count', 0)
|
||||
;
|
||||
->andReturn(Mockery::self())
|
||||
->shouldReceive('with')->once() // another 'with' parameter.
|
||||
->with('accounts',[])
|
||||
->andReturn(Mockery::self())
|
||||
;
|
||||
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 helper:
|
||||
$preferences = $this->mock('Firefly\Helper\Preferences\PreferencesHelperInterface');
|
||||
$preferences->shouldReceive('get')->with('frontpageAccounts',[])->andReturn(new \Preference)->once();
|
||||
|
||||
// call
|
||||
$this->call('GET', '/');
|
||||
|
Reference in New Issue
Block a user