mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 16:10:00 +00:00
Fix and expand tests for #2723
This commit is contained in:
@@ -46,8 +46,7 @@ class ToAccountEndsTest extends TestCase
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$account = $this->user()->accounts()->inRandomOrder()->first();
|
||||
$collection = new Collection([$account]);
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getDestinationAccount')->once()->andReturn($account);
|
||||
|
||||
$trigger = ToAccountEnds::makeFromStrings(substr($account->name, -3), false);
|
||||
$result = $trigger->triggered($journal);
|
||||
@@ -64,8 +63,7 @@ class ToAccountEndsTest extends TestCase
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$account = $this->user()->accounts()->inRandomOrder()->first();
|
||||
$collection = new Collection([$account]);
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getDestinationAccount')->once()->andReturn($account);
|
||||
|
||||
$trigger = ToAccountEnds::makeFromStrings('bla-bla-bla' . $account->name, false);
|
||||
$result = $trigger->triggered($journal);
|
||||
@@ -82,8 +80,7 @@ class ToAccountEndsTest extends TestCase
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$account = $this->user()->accounts()->inRandomOrder()->first();
|
||||
$collection = new Collection([$account]);
|
||||
$repository->shouldReceive('getJournalDestinationAccounts')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getDestinationAccount')->once()->andReturn($account);
|
||||
|
||||
$trigger = ToAccountEnds::makeFromStrings((string)$this->randomInt(), false);
|
||||
$result = $trigger->triggered($journal);
|
||||
|
||||
Reference in New Issue
Block a user