OrderItemDeriverTest.php in Commerce Migrate 3.0.x
File
modules/commerce/tests/src/Kernel/Migrate/commerce1/OrderItemDeriverTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_commerce\Kernel\Migrate\commerce1;
class OrderItemDeriverTest extends Commerce1TestBase {
public static $modules = [
'commerce_price',
'commerce_store',
'commerce_product',
];
protected $pluginManager;
public function setUp() {
parent::setUp();
$this->pluginManager = $this->container
->get('plugin.manager.migration');
}
public function testOrderItemMigration() {
$migrations = $this->pluginManager
->createInstances([
'commerce1_order_item',
]);
$this
->assertArrayHasKey('commerce1_order_item:product', $migrations, "Commerce product migrations exist after commerce_product installed");
$migration = $migrations['commerce1_order_item:product'];
$process = $migration
->getProcess();
$this
->assertArrayHasKey('unit_price', $process, "Commerce order does not have a unit price field.");
$this
->assertArrayHasKey('total_price', $process, "Commerce order does not have a total price field.");
$this
->assertArrayNotHasKey('commerce1_order_item:shipping', $migrations, "Commerce product migrations exist after commerce_product installed");
}
}