Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / migrate_drupal / tests / src / Kernel / d6 / MigrateDrupal6AuditIdsTest.php
index 860f5768dd126da6ac3410ffd4e0d74f4fa72492..a02853f6e12faa834eb871283bbfd3a9cdf3e150 100644 (file)
@@ -7,8 +7,8 @@ use Drupal\migrate\Audit\AuditResult;
 use Drupal\migrate\Audit\IdAuditor;
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
+use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
 use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait;
-use Drupal\workflows\Entity\Workflow;
 
 /**
  * Tests the migration auditor for ID conflicts.
@@ -19,6 +19,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
 
   use FileSystemModuleDiscoveryDataProviderTrait;
   use CreateTestContentEntitiesTrait;
+  use ContentModerationTestTrait;
 
   /**
    * {@inheritdoc}
@@ -44,7 +45,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
     $this->installEntitySchema('content_moderation_state');
     $this->installConfig('content_moderation');
     NodeType::create(['type' => 'page'])->save();
-    $workflow = Workflow::load('editorial');
+    $workflow = $this->createEditorialWorkflow();
     $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page');
     $workflow->save();
   }
@@ -58,10 +59,11 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
     $node->moderation_state->value = 'published';
     $node->save();
 
-    // Insert data in the d6_node:page migration mappping table to simulate a
+    // Insert data in the d6_node:page migration mapping table to simulate a
     // previously migrated node.
-    $table_name = $this->getMigration('d6_node:page')->getIdMap()->mapTableName();
-    $this->container->get('database')->insert($table_name)
+    $id_map = $this->getMigration('d6_node:page')->getIdMap();
+    $table_name = $id_map->mapTableName();
+    $id_map->getDatabase()->insert($table_name)
       ->fields([
         'source_ids_hash' => 1,
         'sourceid1' => 1,
@@ -137,6 +139,7 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
       'd6_taxonomy_term',
       'd6_term_node_revision',
       'd6_user',
+      'node_translation_menu_links',
     ];
     $this->assertEmpty(array_diff(array_filter($conflicts), $expected));
   }
@@ -155,10 +158,11 @@ class MigrateDrupal6AuditIdsTest extends MigrateDrupal6TestBase {
     $node->setNewRevision(TRUE);
     $node->save();
 
-    // Insert data in the d6_node_revision:page migration mappping table to
-    // simulate a previously migrated node revison.
-    $table_name = $this->getMigration('d6_node_revision:page')->getIdMap()->mapTableName();
-    $this->container->get('database')->insert($table_name)
+    // Insert data in the d6_node_revision:page migration mapping table to
+    // simulate a previously migrated node revision.
+    $id_map = $this->getMigration('d6_node_revision:page')->getIdMap();
+    $table_name = $id_map->mapTableName();
+    $id_map->getDatabase()->insert($table_name)
       ->fields([
         'source_ids_hash' => 1,
         'sourceid1' => 1,