You are here

public function CommerceMigrateTestTrait::assertOrderItemType 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::assertOrderItemType()
  2. 3.0.x tests/src/Kernel/CommerceMigrateTestTrait.php \Drupal\Tests\commerce_migrate\Kernel\CommerceMigrateTestTrait::assertOrderItemType()

Asserts an order item type configuration entity.

Parameters

array $expected: An array of order item type information.

  • The order item type.
  • The label for this order item type.
  • The purchasable EntityType.
  • The orderType.
1 call to CommerceMigrateTestTrait::assertOrderItemType()
OrderItemTypeTest::testOrderItemType in modules/commerce/tests/src/Kernel/Migrate/commerce1/OrderItemTypeTest.php
Tests the Drupal 6 taxonomy vocabularies to Drupal 8 migration.

File

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

Class

CommerceMigrateTestTrait
Helper function to test migrations.

Namespace

Drupal\Tests\commerce_migrate\Kernel

Code

public function assertOrderItemType(array $expected) {
  $order_item_type = OrderItemType::load($expected['id']);
  $this
    ->assertInstanceOf(OrderItemType::class, $order_item_type);
  $this
    ->assertSame($expected['label'], $order_item_type
    ->label());
  $this
    ->assertSame($expected['purchasableEntityType'], $order_item_type
    ->getPurchasableEntityTypeId());
  $this
    ->assertSame($expected['orderType'], $order_item_type
    ->getOrderTypeId());
}