summaryrefslogtreecommitdiffstats
path: root/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php')
-rw-r--r--core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
index 5f48683..122199f 100644
--- a/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
+++ b/core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeTest.php
@@ -19,11 +19,16 @@ class MigrateNodeTest extends MigrateNodeTestBase {
/**
* {@inheritdoc}
*/
+ public static $modules = ['language', 'content_translation'];
+
+ /**
+ * {@inheritdoc}
+ */
protected function setUp() {
parent::setUp();
$this->setUpMigratedFiles();
$this->installSchema('file', ['file_usage']);
- $this->executeMigrations(['d6_node']);
+ $this->executeMigrations(['language', 'd6_node', 'd6_node_translation']);
}
/**
@@ -85,6 +90,15 @@ class MigrateNodeTest extends MigrateNodeTestBase {
$this->assertSame('Buy it now', $node->field_test_link->title);
$this->assertSame(['attributes' => ['target' => '_blank']], $node->field_test_link->options);
+ // Test that translations are working.
+ $node = Node::load(10);
+ $this->assertIdentical('en', $node->langcode->value);
+ $this->assertIdentical('The Real McCoy', $node->title->value);
+ $this->assertTrue($node->hasTranslation('fr'), "Node 10 has french translation");
+
+ // Node 11 is a translation of node 10, and should not be imported separately.
+ $this->assertNull(Node::load(11), "Node 11 doesn't exist in D8, it was a translation");
+
// Rerun migration with two source database changes.
// 1. Add an invalid link attributes and a different URL and
// title. If only the attributes are changed the error does not occur.