Expand test coverage.

This commit is contained in:
James Cole
2018-01-05 17:29:42 +01:00
parent c329ffa545
commit 3e9f98b43e
24 changed files with 1150 additions and 93 deletions

View File

@@ -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;
}