You are here

public function ProductTest::testProduct in Commerce Migrate 8.2

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

Test product migration.

File

modules/magento/tests/src/Kernel/Migrate/magento2/ProductTest.php, line 79

Class

ProductTest
Tests Product migration.

Namespace

Drupal\Tests\commerce_migrate_magento\Kernel\Migrate\magento2

Code

public function testProduct() {
  $this
    ->assertProductEntity(1, 'bag', '1', 'Joust Duffle Bag', TRUE, [
    '1',
  ], [
    '1',
  ]);
  $variation = [
    'id' => 1,
    'type' => 'bag',
    'uid' => '1',
    'sku' => '24-MB01',
    'price' => '34.000000',
    'currency' => 'USD',
    'product_id' => '1',
    'title' => 'Joust Duffle Bag',
    'order_item_type_id' => 'default',
    'created_time' => '1521962400',
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
  $this
    ->assertProductEntity(7, 'gear', '1', 'Sprite Foam Roller', TRUE, [
    '1',
  ], [
    '7',
  ]);
  $variation = [
    'id' => 7,
    'type' => 'gear',
    'uid' => '1',
    'sku' => '24-WG088',
    'price' => '19.000000',
    'currency' => 'USD',
    'product_id' => '7',
    'title' => 'Sprite Foam Roller',
    'order_item_type_id' => 'default',
    'created_time' => '1521962400',
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
  $this
    ->assertProductEntity(8, 'sprite_stasis_ball', '1', 'Sprite Stasis Ball 55 cm', TRUE, [
    '1',
  ], [
    '8',
  ]);
  $variation = [
    'id' => 8,
    'type' => 'sprite_stasis_ball',
    'uid' => '1',
    'sku' => '24-WG081-gray',
    'price' => '23.000000',
    'currency' => 'USD',
    'product_id' => '8',
    'title' => 'Sprite Stasis Ball 55 cm',
    'order_item_type_id' => 'default',
    'created_time' => '1521962400',
    'changed_time' => NULL,
    'attributes' => NULL,
  ];
  $this
    ->assertProductVariationEntity($variation);
}