You are here

public function CommerceMigrateTestTrait::assertCurrencyEntity in Commerce Migrate 8.2

Same name and namespace in other branches
  1. 3.1.x tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertCurrencyEntity()
  2. 3.0.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/commerce/tests/src/Kernel/Migrate/commerce1/CurrencyTest.php
Test currency migration from Commerce 1 to Commerce 2.
CurrencyTest::testCurrency in modules/ubercart/tests/src/Kernel/Migrate/uc6/CurrencyTest.php
Test currency migration.

File

tests/src/Kernel/CommerceMigrateTestTrait.php, line 182

Class

CommerceMigrateTestTrait
Helper function to test migrations.

Namespace

Drupal\Tests\commerce_migrate\Kernel

Code

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());
}