3 namespace Drupal\Tests\node\Kernel\Migrate\d7;
5 use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
10 * @group migrate_drupal_7
12 class MigrateNodeDeriverTest extends MigrateDrupal7TestBase {
15 * The migration plugin manager.
17 * @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface
19 protected $pluginManager;
22 * The module handler service.
24 * @var \Drupal\Core\Extension\ModuleHandlerInterface
26 protected $moduleHandler;
31 public function setUp() {
33 $this->pluginManager = $this->container->get('plugin.manager.migration');
34 $this->moduleHandler = $this->container->get('module_handler');
38 * Test node translation migrations with translation disabled.
40 public function testNoTranslations() {
41 // Enabling node module for this test.
42 $this->enableModules(['node']);
43 // Without content_translation, there should be no translation migrations.
44 $migrations = $this->pluginManager->createInstances('d7_node_translation');
45 $this->assertTrue($this->moduleHandler->moduleExists('node'));
46 $this->assertEmpty($migrations);
50 * Test node translation migrations with translation enabled.
52 public function testTranslations() {
53 // With content_translation, there should be translation migrations for
55 $this->enableModules(['language', 'content_translation', 'node', 'filter']);
56 $migrations = $this->pluginManager->createInstances('d7_node_translation');
57 $this->assertArrayHasKey('d7_node_translation:article', $migrations,
58 "Node translation migrations exist after content_translation installed");