mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 06:31:22 +00:00
Fix tests
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user