Improve test coverage.

This commit is contained in:
James Cole
2018-12-18 06:49:26 +01:00
parent 454b3ebd97
commit 29f2ee93d1
2 changed files with 7 additions and 2 deletions

View File

@@ -425,8 +425,14 @@ class ReportControllerTest extends TestCase
$userRepos = $this->mock(UserRepositoryInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$reportHelper = $this->mock(ReportHelperInterface::class);
$asset = $this->getRandomAsset();
// find the user's asset account
$accountRepos->shouldReceive('findNull')->withArgs([1])->andReturn($asset)->atLeast()->once();
// do not find the exp_rev things.
$accountRepos->shouldReceive('findNull')->withArgs([4])->andReturnNull()->atLeast()->once();
$accountRepos->shouldReceive('findNull')->andReturn(null)->times(3);
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
$data = [