Fix a few tests.

This commit is contained in:
James Cole
2018-03-23 05:31:30 +01:00
parent 3b735c7533
commit fb0a0c3fb5
18 changed files with 198 additions and 165 deletions

View File

@@ -124,6 +124,7 @@ class AccountControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$repository = $this->mock(CurrencyRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$repository->shouldReceive('findNull')->once()->andReturn(TransactionCurrency::find(1));
$repository->shouldReceive('get')->andReturn(new Collection);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
@@ -194,6 +195,8 @@ class AccountControllerTest extends TestCase
$repository = $this->mock(AccountRepositoryInterface::class);
$repository->shouldReceive('oldestJournalDate')->andReturn(clone $date)->once();
$repository->shouldReceive('getMetaValue')->andReturn('');
$transaction = factory(Transaction::class)->make();
$collector = $this->mock(JournalCollectorInterface::class);
@@ -272,6 +275,7 @@ class AccountControllerTest extends TestCase
$repository = $this->mock(AccountRepositoryInterface::class);
$repository->shouldReceive('oldestJournalDate')->andReturn(new Carbon);
$repository->shouldReceive('getMetaValue')->andReturn('');
$collector->shouldReceive('setTypes')->andReturnSelf();
$collector->shouldReceive('withOpposingAccount')->andReturnSelf();

View File

@@ -113,6 +113,7 @@ class AttachmentControllerTest extends TestCase
{
$attachRepository = $this->mock(AttachmentRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$attachRepository->shouldReceive('getNoteText')->andReturn('OK');
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$response = $this->get(route('attachments.edit', [1]));