mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 13:16:31 +00:00
Improve test coverage.
This commit is contained in:
@@ -69,13 +69,6 @@ class SetDestinationAccount implements ActionInterface
|
||||
$this->journal = $journal;
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser($journal->user);
|
||||
$count = $journal->transactions()->count();
|
||||
if ($count > 2) {
|
||||
Log::error(sprintf('Cannot change destination account of journal #%d because it is a split journal.', $journal->id));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// journal type:
|
||||
$type = $journal->transactionType->type;
|
||||
|
||||
@@ -103,7 +96,7 @@ class SetDestinationAccount implements ActionInterface
|
||||
// get destination transaction:
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
if (null === $transaction) {
|
||||
return true;
|
||||
return true; // @codeCoverageIgnore
|
||||
}
|
||||
$transaction->account_id = $this->newDestinationAccount->id;
|
||||
$transaction->save();
|
||||
|
||||
Reference in New Issue
Block a user