public function CommerceMigrateTestTrait::assertCurrencyEntity in Commerce Migrate 3.0.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertCurrencyEntity()
- 3.1.x tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertCurrencyEntity()
Asserts a Currency entity.
Parameters
int $id: The currency id.
string $currency_code: The currency code.
string $name: The name of the currency.
string $numeric_code: The numeric code for the currency.
string $fraction_digits: The number of fraction digits for this currency.
string $symbol: The currency symbol.
3 calls to CommerceMigrateTestTrait::assertCurrencyEntity()
- CurrencyTest::testCurrency in modules/
ubercart/ tests/ src/ Kernel/ Migrate/ uc7/ CurrencyTest.php - Test currency migration.
- CurrencyTest::testCurrency in modules/
ubercart/ tests/ src/ Kernel/ Migrate/ uc6/ CurrencyTest.php - Test currency migration.
- CurrencyTest::testCurrency in modules/
commerce/ tests/ src/ Kernel/ Migrate/ commerce1/ CurrencyTest.php - Test currency migration from Commerce 1 to Commerce 2.
File
- tests/
src/ Kernel/ CommerceMigrateTestTrait.php, line 182
Class
- CommerceMigrateTestTrait
- Helper function to test migrations.
Namespace
Drupal\Tests\commerce_migrate\KernelCode
public function assertCurrencyEntity($id, $currency_code, $name, $numeric_code, $fraction_digits, $symbol) {
/** @var \Drupal\commerce_price\Entity\CurrencyInterface $currency */
$currency = Currency::load($id);
$this
->assertInstanceOf(CurrencyInterface::class, $currency);
$this
->assertSame($currency_code, $currency
->getCurrencyCode());
$this
->assertSame($name, $currency
->getName());
$this
->assertSame($fraction_digits, $currency
->getFractionDigits());
$this
->assertSame($numeric_code, $currency
->getNumericCode());
$this
->assertSame($symbol, $currency
->getSymbol());
}