You are here

public function CurrencyTest::testCurrencyEditing in Commerce Core 8.2

Tests editing a currency.

File

modules/price/tests/src/Functional/CurrencyTest.php, line 73

Class

CurrencyTest
Tests the currency UI.

Namespace

Drupal\Tests\commerce_price\Functional

Code

public function testCurrencyEditing() {
  $this
    ->createEntity('commerce_currency', [
    'currencyCode' => 'XXX',
    'name' => 'Test currency',
    'numericCode' => 999,
    'symbol' => '§',
    'fractionDigits' => 2,
  ]);
  $this
    ->drupalGet('admin/commerce/config/currencies/XXX');
  $edit = [
    'name' => 'Test currency2',
    'numericCode' => 999,
    'symbol' => '§',
    'fractionDigits' => 2,
  ];
  $this
    ->submitForm($edit, 'Save');
  $currency = Currency::load('XXX');
  $this
    ->assertEquals($edit['name'], $currency
    ->getName());
}