reverted: --- b/modules/ubercart/migrations/ubercart_product_variation.yml +++ a/modules/ubercart/migrations/d6_ubercart_product_variation.yml @@ -2,15 +2,13 @@ # # For my use case, I had to create several different product variation types # and write an individual migration for each one. This is meant to be an example. +id: d6_ubercart_product_variation -id: ubercart_product_variation label: Migrate product variations from Ubercart migration_tags: - Drupal 6 - Ubercart - - Drupal 7 - - Drupal 7 Ubercart source: + plugin: d6_ubercart_product_variation - plugin: ubercart_product_variation process: type: plugin: default_value diff -u b/modules/ubercart/src/Plugin/migrate/source/ProductVariation.php b/modules/ubercart/src/Plugin/migrate/source/ProductVariation.php --- b/modules/ubercart/src/Plugin/migrate/source/ProductVariation.php +++ b/modules/ubercart/src/Plugin/migrate/source/ProductVariation.php @@ -1,6 +1,6 @@ installEntitySchema('node'); + $this->installEntitySchema('view'); + $this->installEntitySchema('commerce_product_variation'); + $this->installEntitySchema('commerce_product'); + $this->installConfig(static::$modules); + $this->migrateStore(); + $this->executeMigrations([ + 'd7_filter_formats', + 'd7_user_role', + 'd7_user', + 'd7_node_type', + // @todo add migrations for the following: + // d7_ubercart_product_type + //'d7_field', + //'d7_field_instance', + //'d7_ubercart_attribute_field', + //'d7_ubercart_product_attribute', + //'d7_ubercart_attribute_field_instance', + //'d7_ubercart_attribute_instance_widget_settings', + 'd7_ubercart_product_variation', + ]); + } + + /** + * Test product variation migration from Drupal 6 to 8. + */ + public function testProductVariation() { + $this->assertProductVariationEntity(1, '1', 'towel-bath-001', '20.000000', 'NZD', '1', 'Bath Towel', 'default', '1492867780', NULL); + $this->assertProductVariationEntity(2, '1', 'towel-beach-001', '15.000000', 'NZD', '2', 'Beach Towel', 'default', '1492989418', NULL); + $this->assertProductVariationEntity(3, '1', 'Fairy-Cake-001', '1500.000000', 'NZD', '3', 'Fairy cake', 'default', '1492989703', NULL); + $this->assertProductVariationEntity(4, '1', 'ship-001', '6000000000.000000', 'NZD', '4', 'Golgafrincham B-Ark', 'default', '1500868190', NULL); + $this->assertProductVariationEntity(5, '1', 'ship-002', '123000000.000000', 'NZD', '5', 'Heart of Gold', 'default', '1500868361', NULL); + } + +} only in patch2: unchanged: --- a/modules/ubercart/tests/src/Kernel/Plugin/migrate/source/d6/ProductVariationTest.php +++ b/modules/ubercart/tests/src/Kernel/Plugin/migrate/source/d6/ProductVariationTest.php @@ -7,7 +7,7 @@ use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase; /** * Tests the d6 ubercart order product source plugin. * - * @covers \Drupal\commerce_migrate_ubercart\Plugin\migrate\source\d6\ProductVariation + * @covers \Drupal\commerce_migrate_ubercart\Plugin\migrate\source\ProductVariation * @group commerce_migrate * @group commerce_migrate_ubercart_d6 */