Fix tests

This commit is contained in:
James Cole
2019-08-11 07:25:59 +02:00
parent c4964cf603
commit 8545d73119
4 changed files with 38 additions and 15 deletions

View File

@@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Console\Command;
@@ -61,6 +62,8 @@ class OtherCurrenciesCorrections extends Command
private $currencyRepos;
/** @var JournalRepositoryInterface */
private $journalRepos;
/** @var JournalCLIRepositoryInterface */
private $cliRepos;
/** @var int */
private $count;
@@ -105,6 +108,7 @@ class OtherCurrenciesCorrections extends Command
$this->accountRepos = app(AccountRepositoryInterface::class);
$this->currencyRepos = app(CurrencyRepositoryInterface::class);
$this->journalRepos = app(JournalRepositoryInterface::class);
$this->cliRepos = app(JournalCLIRepositoryInterface::class);
}
/**
@@ -166,6 +170,7 @@ class OtherCurrenciesCorrections extends Command
$this->accountRepos->setUser($journal->user);
$this->journalRepos->setUser($journal->user);
$this->currencyRepos->setUser($journal->user);
$this->cliRepos->setUser($journal->user);
$leadTransaction = $this->getLeadTransaction($journal);
@@ -223,7 +228,7 @@ class OtherCurrenciesCorrections extends Command
private function updateOtherJournalsCurrencies(): void
{
$set =
$this->journalRepos->getAllJournals(
$this->cliRepos->getAllJournals(
[
TransactionType::WITHDRAWAL,
TransactionType::DEPOSIT,

View File

@@ -242,7 +242,7 @@ class TransferCurrenciesCorrections extends Command
*/
private function startUpdateRoutine(): void
{
$set = $this->journalRepos->getAllJournals([TransactionType::TRANSFER]);
$set = $this->cliRepos->getAllJournals([TransactionType::TRANSFER]);
/** @var TransactionJournal $journal */
foreach ($set as $journal) {
$this->updateTransferCurrency($journal);