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 / d7 / MigrateDrupal7AuditIdsTest.php
index 351ab43d7261fab6491f1992f1797f3f6501ba8a..1693ce16232097692a1fd852d081285fd5586c6c 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 MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
 
   use FileSystemModuleDiscoveryDataProviderTrait;
   use CreateTestContentEntitiesTrait;
+  use ContentModerationTestTrait;
 
   /**
    * {@inheritdoc}
@@ -44,7 +45,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
     $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 MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
     $node->moderation_state->value = 'published';
     $node->save();
 
-    // Insert data in the d7_node:page migration mappping table to simulate a
+    // Insert data in the d7_node:page migration mapping table to simulate a
     // previously migrated node.
-    $table_name = $this->getMigration('d7_node:page')->getIdMap()->mapTableName();
-    $this->container->get('database')->insert($table_name)
+    $id_map = $this->getMigration('d7_node:page')->getIdMap();
+    $table_name = $id_map->mapTableName();
+    $id_map->getDatabase()->insert($table_name)
       ->fields([
         'source_ids_hash' => 1,
         'sourceid1' => 1,
@@ -136,6 +138,7 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
       'd7_node_revision',
       'd7_taxonomy_term',
       'd7_user',
+      'node_translation_menu_links',
     ];
     $this->assertEmpty(array_diff(array_filter($conflicts), $expected));
   }
@@ -154,10 +157,11 @@ class MigrateDrupal7AuditIdsTest extends MigrateDrupal7TestBase {
     $node->setNewRevision(TRUE);
     $node->save();
 
-    // Insert data in the d7_node_revision:page migration mappping table to
-    // simulate a previously migrated node revison.
-    $table_name = $this->getMigration('d7_node_revision:page')->getIdMap()->mapTableName();
-    $this->container->get('database')->insert($table_name)
+    // Insert data in the d7_node_revision:page migration mapping table to
+    // simulate a previously migrated node revision.
+    $id_map = $this->getMigration('d7_node_revision:page')->getIdMap();
+    $table_name = $id_map->mapTableName();
+    $id_map->getDatabase()->insert($table_name)
       ->fields([
         'source_ids_hash' => 1,
         'sourceid1' => 1,