You are here

public function OrderItemTypeTest::testEdit in Commerce Core 8.2

Tests editing an order item type.

File

modules/order/tests/src/Functional/OrderItemTypeTest.php, line 49

Class

OrderItemTypeTest
Tests the order item type UI.

Namespace

Drupal\Tests\commerce_order\Functional

Code

public function testEdit() {
  $this
    ->drupalGet('admin/commerce/config/order-item-types/default/edit');
  $edit = [
    'label' => 'Default!',
  ];
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->pageTextContains('Saved the Default! order item type.');
  $order_item_type = OrderItemType::load('default');
  $this
    ->assertEquals($edit['label'], $order_item_type
    ->label());
}