ProfileDeriverTest.php in Commerce Migrate 8.2
File
modules/commerce/tests/src/Kernel/Migrate/commerce1/ProfileDeriverTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1;
class ProfileDeriverTest extends Commerce1TestBase {
public static $modules = [
'commerce_store',
'profile',
];
protected $pluginManager;
public function setUp() {
parent::setUp();
$this->pluginManager = $this->container
->get('plugin.manager.migration');
}
public function testProfileMigrations() {
$migrations = $this->pluginManager
->createInstances([
'commerce1_profile',
]);
$profile_types = [
'billing',
'shipping',
];
foreach ($profile_types as $type) {
$derivative = "commerce1_profile:{$type}";
$this
->assertArrayHasKey($derivative, $migrations, "Commerce profile '{$type}' migrations do not exist after profile installed");
$migration = $migrations[$derivative];
$process = $migration
->getProcess();
$this
->assertArrayHasKey('address', $process, "Commerce profile '{$type}' does not have address.");
}
}
}