Improve test coverage and efficiency for accounts and budgets.

This commit is contained in:
James Cole
2019-06-23 11:13:36 +02:00
parent 8f25562923
commit 43d753e5bd
47 changed files with 919 additions and 985 deletions

View File

@@ -298,11 +298,11 @@ class TransferCurrenciesCorrectionsTest extends TestCase
$dollar = $this->getDollar();
// make sure that source and destination have the right currencies beforehand
$source = $transfer->transactions()->where('amount', '<', 0)->first();
$source = $transfer->transactions()->where('amount', '<', 0)->first();
$source->transaction_currency_id = $euro->id;
$source->save();
$dest= $transfer->transactions()->where('amount', '>', 0)->first();
$dest = $transfer->transactions()->where('amount', '>', 0)->first();
$dest->transaction_currency_id = $dollar->id;
$dest->save();
@@ -448,7 +448,6 @@ class TransferCurrenciesCorrectionsTest extends TestCase
*/
public function testHandleTransferBadSourceCurrency(): void
{
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
@@ -459,6 +458,7 @@ class TransferCurrenciesCorrectionsTest extends TestCase
/** @var Transaction $source */
$source = $transfer->transactions()->where('amount', '<', 0)->first();
$source->transaction_currency_id = 2;
$source->foreign_amount = null;
$source->save();
// mock calls: