You are here

public function ProductAttributeTest::testMigrateProductAttributeTest in Commerce Migrate 3.0.x

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

Test attribute migration from Commerce 1.

File

modules/commerce/tests/src/Kernel/Migrate/commerce1/ProductAttributeTest.php, line 62

Class

ProductAttributeTest
Tests commerce field instance migration.

Namespace

Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1

Code

public function testMigrateProductAttributeTest() {
  $this
    ->assertProductAttributeEntity('bag_size', 'Bag size', 'select');
  $this
    ->assertProductAttributeEntity('color', 'Color', 'select');
  $this
    ->assertProductAttributeEntity('hat_size', 'Hat size', 'select');
  $this
    ->assertProductAttributeEntity('shoe_size', 'Shoe size', 'select');

  // Tests that the attribute name longer than 32 characters is truncated.
  $this
    ->assertProductAttributeEntity('storage_capacity_with_very_lo', 'Storage capacity', 'select');
  $this
    ->assertProductAttributeEntity('top_size', 'Top size', 'select');
}