Fix test coverage.

This commit is contained in:
James Cole
2018-12-09 20:54:11 +01:00
parent 97f6e68164
commit ae4612f134
46 changed files with 383 additions and 229 deletions

View File

@@ -122,9 +122,16 @@ class MassControllerTest extends TestCase
$journalRepos->shouldReceive('getJournalSourceAccounts')->andReturn(new Collection([$source]));
$journalRepos->shouldReceive('getJournalDestinationAccounts')->andReturn(new Collection([$source]));
$journalRepos->shouldReceive('getTransactionType')->andReturn('Transfer');
$journalRepos->shouldReceive('isJournalReconciled')->andReturn(false);
$journalRepos->shouldReceive('getFirstPosTransaction')->andReturn($transfers->first()->transactions()->first());
// get all kinds of meta fields (the transformer needs this)
$journalRepos->shouldReceive('getNoteText')->andReturn('Hello');
$journalRepos->shouldReceive('getMetaField')->withAnyArgs()->andReturnNull();
$journalRepos->shouldReceive('getMetaDateString')->withAnyArgs()->andReturnNull();
// mock stuff:
$repository = $this->mock(AccountRepositoryInterface::class);
@@ -172,6 +179,11 @@ class MassControllerTest extends TestCase
$journalRepos->shouldReceive('isJournalReconciled')
->andReturn(true, false, false, false, false);
// get all kinds of meta fields (the transformer needs this)
$journalRepos->shouldReceive('getNoteText')->andReturn('Hello');
$journalRepos->shouldReceive('getMetaField')->withAnyArgs()->andReturnNull();
$journalRepos->shouldReceive('getMetaDateString')->withAnyArgs()->andReturnNull();
// default transactions
$collection = $this->user()->transactionJournals()->take(5)->get();