Expand test coverage.

This commit is contained in:
James Cole
2018-03-03 14:24:06 +01:00
parent 99d116f4ce
commit 9dc4c50527
17 changed files with 311 additions and 56 deletions

View File

@@ -36,8 +36,12 @@ class FromAccountIsTest extends TestCase
*/
public function testTriggered()
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
$count = 0;
while ($count === 0) {
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$count = $journal->transactions()->where('amount', '<', 0)->count();
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
}
$account = $transaction->account;
$trigger = FromAccountIs::makeFromStrings($account->name, false);