mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 08:30:06 +00:00
Fix and expand tests for #2723
This commit is contained in:
@@ -45,8 +45,7 @@ class FromAccountEndsTest extends TestCase
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$account = $this->user()->accounts()->inRandomOrder()->first();
|
||||
$collection = new Collection([$account]);
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getSourceAccount')->once()->andReturn($account);
|
||||
|
||||
$trigger = FromAccountEnds::makeFromStrings(substr($account->name, -3), false);
|
||||
$result = $trigger->triggered($journal);
|
||||
@@ -63,8 +62,7 @@ class FromAccountEndsTest extends TestCase
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$account = $this->user()->accounts()->inRandomOrder()->first();
|
||||
$collection = new Collection([$account]);
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getSourceAccount')->once()->andReturn($account);
|
||||
|
||||
$trigger = FromAccountEnds::makeFromStrings('bla-bla-bla' . $account->name, false);
|
||||
$result = $trigger->triggered($journal);
|
||||
@@ -81,8 +79,7 @@ class FromAccountEndsTest extends TestCase
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->user()->transactionJournals()->inRandomOrder()->first();
|
||||
$account = $this->user()->accounts()->inRandomOrder()->first();
|
||||
$collection = new Collection([$account]);
|
||||
$repository->shouldReceive('getJournalSourceAccounts')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getSourceAccount')->once()->andReturn($account);
|
||||
|
||||
$trigger = FromAccountEnds::makeFromStrings('some name' . random_int(1, 234), false);
|
||||
$result = $trigger->triggered($journal);
|
||||
|
||||
Reference in New Issue
Block a user