From 5f768a052582227a3c5e047a5ed161995fe51153 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 11 Jun 2019 21:21:50 +0200 Subject: [PATCH] Fix budget limit test, and a bug in the other currencies corrector. --- app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php | 4 ++-- .../Unit/Console/Commands/Upgrade/BudgetLimitCurrencyTest.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php index 6a235c686d..d7f4ff51fe 100644 --- a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php +++ b/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php @@ -205,7 +205,7 @@ class OtherCurrenciesCorrections extends Command if (null === $transaction->transaction_currency_id) { $transaction->transaction_currency_id = $currency->id; $transaction->save(); - $this->count++; + //$this->count++; } // when mismatch in transaction: @@ -214,7 +214,7 @@ class OtherCurrenciesCorrections extends Command $transaction->foreign_amount = $transaction->amount; $transaction->transaction_currency_id = $currency->id; $transaction->save(); - $this->count++; + //$this->count++; } } ); diff --git a/tests/Unit/Console/Commands/Upgrade/BudgetLimitCurrencyTest.php b/tests/Unit/Console/Commands/Upgrade/BudgetLimitCurrencyTest.php index f2d55e6eab..34c6cddc50 100644 --- a/tests/Unit/Console/Commands/Upgrade/BudgetLimitCurrencyTest.php +++ b/tests/Unit/Console/Commands/Upgrade/BudgetLimitCurrencyTest.php @@ -47,7 +47,10 @@ class BudgetLimitCurrencyTest extends TestCase */ public function testHandle(): void { + BudgetLimit::whereNull('transaction_currency_id')->forceDelete(); + $this->artisan('firefly-iii:bl-currency') + ->expectsOutput('All budget limits are correct.') ->assertExitCode(0); }