You are here

public function ViewModesTest::testMigration in Commerce Migrate 8.2

Same name in this branch
  1. 8.2 modules/ubercart/tests/src/Kernel/Migrate/uc7/ViewModesTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc7\ViewModesTest::testMigration()
  2. 8.2 modules/ubercart/tests/src/Kernel/Migrate/uc6/ViewModesTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6\ViewModesTest::testMigration()
  3. 8.2 modules/commerce/tests/src/Kernel/Migrate/commerce1/ViewModesTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\ViewModesTest::testMigration()
Same name and namespace in other branches
  1. 3.1.x modules/commerce/tests/src/Kernel/Migrate/commerce1/ViewModesTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\ViewModesTest::testMigration()
  2. 3.0.x modules/commerce/tests/src/Kernel/Migrate/commerce1/ViewModesTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1\ViewModesTest::testMigration()

Tests migration of D7 view mode variables to D8 config entities.

File

modules/commerce/tests/src/Kernel/Migrate/commerce1/ViewModesTest.php, line 71

Class

ViewModesTest
Tests view mode migration.

Namespace

Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1

Code

public function testMigration() {
  $this
    ->assertEntity('commerce_product.full', 'Full', 'commerce_product');
  $this
    ->assertEntity('commerce_product.teaser', 'Teaser', 'commerce_product');
  $this
    ->assertEntity('commerce_product.product_list', 'product_list', 'commerce_product');
  $this
    ->assertEntity('commerce_product.product_in_cart', 'product_in_cart', 'commerce_product');
  $this
    ->assertEntity('commerce_product_variation.add_to_cart_confirmation_view', 'add_to_cart_confirmation_view', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.commerce_line_item_display', 'commerce_line_item_display', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.full', 'Full', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.line_item', 'line_item', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.node_full', 'node_full', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.node_product_list', 'node_product_list', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.node_rss', 'node_rss', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.node_search_index', 'node_search_index', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.node_search_result', 'node_search_result', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.node_teaser', 'node_teaser', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.product_in_cart', 'product_in_cart', 'commerce_product_variation');
  $this
    ->assertEntity('commerce_product_variation.add_to_cart_confirmation_view', 'add_to_cart_confirmation_view', 'commerce_product_variation');

  // Test there are no errors in the map table.
  $migration = $this
    ->getMigration('d7_view_modes');
  $errors = $migration
    ->getIdMap()
    ->errorCount();
  $this
    ->assertSame(0, $errors);
}