Some generic code refactoring.

This commit is contained in:
James Cole
2019-06-21 19:10:02 +02:00
parent fb1af395f9
commit 2d3d7f7720
67 changed files with 920 additions and 603 deletions

View File

@@ -297,7 +297,14 @@ class TransferCurrenciesCorrectionsTest extends TestCase
$euro = $this->getEuro();
$dollar = $this->getDollar();
// make sure that source and destination have the right currencies beforehand
$source = $transfer->transactions()->where('amount', '<', 0)->first();
$source->transaction_currency_id = $euro->id;
$source->save();
$dest= $transfer->transactions()->where('amount', '>', 0)->first();
$dest->transaction_currency_id = $dollar->id;
$dest->save();
// mock calls:
$journalRepos->shouldReceive('getAllJournals')
@@ -325,7 +332,7 @@ class TransferCurrenciesCorrectionsTest extends TestCase
FireflyConfig::shouldReceive('set')->withArgs(['4780_transfer_currencies', true]);
$this->artisan('firefly-iii:transfer-currencies')
->expectsOutput('Verified currency information of 2 transfer(s).')
->expectsOutput('Verified currency information of 1 transfer(s).')
->assertExitCode(0);
// source and destination transaction should be corrected: