Update for bug fix release.

This commit is contained in:
James Cole
2018-07-13 06:12:39 +02:00
parent 5846431b34
commit bcdb849b46
7 changed files with 74 additions and 35 deletions

View File

@@ -38,19 +38,20 @@ class ToAccountStartsTest extends TestCase
public function testTriggered(): void
{
Log::debug('Now in testTriggered');
$loopCount = 0;
$account = null;
do {
Log::debug(sprintf('Count of loop: %d', $loopCount));
$journal = $this->user()->transactionJournals()->inRandomOrder()->whereNull('deleted_at')->first();
$count = $journal->transactions()->where('amount', '>', 0)->count();
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
$account = null === $transaction ? null : $transaction->account;
Log::debug(sprintf('Journal with id #%d', $journal->id));
Log::debug(sprintf('Count of transactions is %d', $count));
Log::debug(sprintf('Account is null: %s', var_export(null === $account, true)));
} while ($loopCount < 30 && $count !== 1 && null !== $account);
} while ($loopCount < 30 && $count < 1 && null !== $account);
$trigger = ToAccountStarts::makeFromStrings(substr($account->name, 0, -3), false);