Update some tests.

This commit is contained in:
James Cole
2020-01-05 19:29:28 +01:00
parent 465947dddf
commit 39d61feede
26 changed files with 211 additions and 140 deletions

View File

@@ -87,6 +87,7 @@ class ShowControllerTest extends TestCase
$repository->shouldReceive('getAccountCurrency')->andReturn($euro)->atLeast()->once();
$repository->shouldReceive('oldestJournalDate')->andReturn(clone $date)->once();
$repository->shouldReceive('getLocation')->atLeast()->once()->andReturnNull();
// list size
$pref = new Preference;
@@ -143,11 +144,14 @@ class ShowControllerTest extends TestCase
$repository->shouldReceive('isLiability')->andReturn(false)->atLeast()->once();
$repository->shouldReceive('getAccountCurrency')->andReturn($euro)->atLeast()->once();
$repository->shouldReceive('oldestJournalDate')->andReturn(clone $date)->once();
$repository->shouldReceive('getLocation')->atLeast()->once()->andReturnNull();
// list size
$pref = new Preference;
$pref->data = 50;
Preferences::shouldReceive('get')->withArgs(['listPageSize', 50])->atLeast()->once()->andReturn($pref);
Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
// mock hasRole for user repository:
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->andReturn(true)->atLeast()->once();