ProductNodeMigrationTest.php in Commerce Migrate 8.2
File
modules/ubercart/tests/src/Kernel/Migrate/uc6/ProductNodeMigrationTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_ubercart\Kernel\Migrate\uc6;
class ProductNodeMigrationTest extends Ubercart6TestBase {
protected $pluginManager;
public function setUp() {
parent::setUp();
$this->pluginManager = $this->container
->get('plugin.manager.migration');
}
public function testNoProducts() {
$migrations = $this->pluginManager
->createInstances([
'd6_node',
]);
$name = 'd6_node:page';
$this
->assertArrayHasKey($name, $migrations, 'Node type page migration exists.');
$migration = $migrations[$name];
$destination = $migration
->getDestinationConfiguration();
$this
->assertSame('entity:node', $destination['plugin']);
$name = 'd6_node:story';
$this
->assertArrayHasKey($name, $migrations, 'Node type story migration exists.');
$migration = $migrations[$name];
$destination = $migration
->getDestinationConfiguration();
$this
->assertSame('entity:node', $destination['plugin']);
$name = 'd6_node:product';
$this
->assertArrayHasKey($name, $migrations, 'Product type product migration exists.');
$migration = $migrations[$name];
$destination = $migration
->getDestinationConfiguration();
$this
->assertSame('entity:commerce_product', $destination['plugin']);
$this
->enableModules([
'language',
'content_translation',
]);
$migrations = $this->pluginManager
->createInstances([
'd6_node_translation',
]);
$this
->assertArrayNotHasKey('d6_node_translation:page', $migrations, 'Node translation migration for page exists.');
$this
->assertArrayNotHasKey('d6_node_translation:story', $migrations, 'Node translation migration for story exists.');
$this
->assertArrayNotHasKey('d6_node_translation:product', $migrations, 'Node translation migration for product exists.');
}
}