You are here

public function ProductVariationTest::testProductVariation in Commerce Migrate 3.0.x

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

Test product variation migration.

File

modules/shopify/tests/src/Kernel/Migrate/ProductVariationTest.php, line 75

Class

ProductVariationTest
Tests product variation migration.

Namespace

Drupal\Tests\commerce_migrate_shopify\Kernel\Migrate\shopify

Code

public function testProductVariation() {
  $variation = [
    'id' => 1,
    'type' => 'bag_accessory',
    'uid' => '1',
    'sku' => 'THEB15--1-Size',
    'price' => '30.000000',
    'currency' => 'USD',
    'product_id' => NULL,
    'title' => '',
    'order_item_type_id' => 'default',
    'created_time' => NULL,
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
  $variation = [
    'id' => 2,
    'type' => 'bag_accessory',
    'uid' => '1',
    'sku' => 'YMB01-Green--1-Size',
    'price' => '18.950000',
    'currency' => 'USD',
    'product_id' => NULL,
    'title' => '',
    'order_item_type_id' => 'default',
    'created_time' => NULL,
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
  $variation = [
    'id' => 3,
    'type' => 'bag_accessory',
    'uid' => '1',
    'sku' => 'YMB01-Yellow--1-Size',
    'price' => '18.950000',
    'currency' => 'USD',
    'product_id' => NULL,
    'title' => '',
    'order_item_type_id' => 'default',
    'created_time' => NULL,
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
  $variation = [
    'id' => 4,
    'type' => 'mens_short_sleeve_t_shirts',
    'uid' => '1',
    'sku' => 'YGS08-White--1-Size',
    'price' => '12.000000',
    'currency' => 'USD',
    'product_id' => NULL,
    'title' => '',
    'order_item_type_id' => 'default',
    'created_time' => NULL,
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
  $variation = [
    'id' => 5,
    'type' => 'mens_t_shirt',
    'uid' => '1',
    'sku' => 'MT01-Brick--M',
    'price' => '18.000000',
    'currency' => 'USD',
    'product_id' => NULL,
    'title' => '',
    'order_item_type_id' => 'default',
    'created_time' => NULL,
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
  $variation = [
    'id' => 12,
    'type' => 'mens_t_shirt',
    'uid' => '1',
    'sku' => 'MT01-Gray--XXL',
    'price' => '18.000000',
    'currency' => 'USD',
    'product_id' => NULL,
    'title' => '',
    'order_item_type_id' => 'default',
    'created_time' => NULL,
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
}