ProductVariationDeriverTest.php in Commerce Migrate 3.0.x
File
modules/commerce/tests/src/Kernel/Migrate/commerce1/ProductVariationDeriverTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1;
class ProductVariationDeriverTest extends Commerce1TestBase {
public static $modules = [
'commerce_product',
'commerce_store',
];
protected $pluginManager;
public function setUp() {
parent::setUp();
$this->pluginManager = $this->container
->get('plugin.manager.migration');
}
public function testProductVariationMigrations() {
$migrations = $this->pluginManager
->createInstances([
'commerce1_product_variation',
]);
$this
->assertArrayHasKey('commerce1_product_variation:drinks', $migrations, "Commerce product variation migrations exist after commerce_product installed");
$migration = $migrations['commerce1_product_variation:shoes'];
$process = $migration
->getProcess();
$this
->assertArrayHasKey('field_employee_price_shoes', $process, "Commerce product variation shoes has employee_price_shoes field.");
$migration = $migrations['commerce1_product_variation:drinks'];
$process = $migration
->getProcess();
$this
->assertArrayHasKey('field_employee_price', $process, "Commerce product variation drinks has employee_price field.");
}
}