mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Expand test coverage.
This commit is contained in:
@@ -22,7 +22,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Import\Mapper;
|
||||
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
|
||||
/**
|
||||
* Class TransactionCurrencies.
|
||||
@@ -34,15 +34,16 @@ class TransactionCurrencies implements MapperInterface
|
||||
*/
|
||||
public function getMap(): array
|
||||
{
|
||||
$currencies = TransactionCurrency::get();
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$currencies = $repository->get();
|
||||
$list = [];
|
||||
foreach ($currencies as $currency) {
|
||||
$list[$currency->id] = $currency->name . ' (' . $currency->code . ')';
|
||||
$currencyId = intval($currency->id);
|
||||
$list[$currencyId] = $currency->name . ' (' . $currency->code . ')';
|
||||
}
|
||||
|
||||
asort($list);
|
||||
|
||||
$list = [0 => trans('import.map_do_not_map')] + $list;
|
||||
$list = array_merge([0 => trans('import.map_do_not_map')], $list);
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user