public function CurrencyRepositoryTest::testGet in Commerce Core 8.2
@covers ::get
File
- modules/
price/ tests/ src/ Kernel/ CurrencyRepositoryTest.php, line 48
Class
- CurrencyRepositoryTest
- Tests the currency repository.
Namespace
Drupal\Tests\commerce_price\KernelCode
public function testGet() {
$expected_eur = new Currency([
'currency_code' => 'EUR',
'name' => 'Euro',
'numeric_code' => '978',
'symbol' => '€',
'fraction_digits' => 2,
'locale' => 'en',
]);
$expected_usd = new Currency([
'currency_code' => 'USD',
'name' => 'US Dollar',
'numeric_code' => '840',
'symbol' => '$',
'fraction_digits' => 2,
'locale' => 'en',
]);
$this
->assertEquals($expected_eur, $this->currencyRepository
->get('EUR'));
$this
->assertEquals($expected_usd, $this->currencyRepository
->get('USD'));
}