ProductDeriverTest.php in Commerce Migrate 3.0.x
File
modules/commerce/tests/src/Kernel/Migrate/commerce1/ProductDeriverTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1;
class ProductDeriverTest 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 testProductMigrations() {
$migrations = $this->pluginManager
->createInstances([
'commerce1_product',
]);
$this
->assertArrayHasKey('commerce1_product:drinks', $migrations, "Commerce product migrations exist after commerce_product installed");
$migration = $migrations['commerce1_product:bags_cases'];
$process = $migration
->getProcess();
$this
->assertArrayHasKey('field_collection', $process, "Commerce product bags and cases has collection field.");
$this
->assertArrayHasKey('field_category', $process, "Commerce product bags and cases has category field.");
$this
->assertArrayHasKey('field_gender', $process, "Commerce product bags and cases has gender field.");
$this
->assertArrayHasKey('field_brand', $process, "Commerce product bags and cases has brand field.");
}
}