You are here

public function ShipmentTypeTest::testCreateShipmentType in Commerce Shipping 8.2

Tests creating a shipment type.

File

tests/src/Functional/ShipmentTypeTest.php, line 67

Class

ShipmentTypeTest
Tests the shipment type UI.

Namespace

Drupal\Tests\commerce_shipping\Functional

Code

public function testCreateShipmentType() {
  $this
    ->drupalGet('admin/commerce/config/shipment-types/add');
  $edit = [
    'id' => 'foo',
    'label' => 'Foo label',
    'profileType' => 'customer',
  ];
  $this
    ->submitForm($edit, 'Save');
  $shipment_type = ShipmentType::load($edit['id']);
  $this
    ->assertNotEmpty($shipment_type);
  $this
    ->assertEquals('Foo label', $shipment_type
    ->label());
  $this
    ->assertEquals('customer', $shipment_type
    ->getProfileTypeId());
}