X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FKernel%2Fd7%2FMigrateDrupal7AuditIdsTest.php;fp=web%2Fcore%2Fmodules%2Fmigrate_drupal%2Ftests%2Fsrc%2FKernel%2Fd7%2FMigrateDrupal7AuditIdsTest.php;h=1693ce16232097692a1fd852d081285fd5586c6c;hp=351ab43d7261fab6491f1992f1797f3f6501ba8a;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php b/web/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php index 351ab43d7..1693ce162 100644 --- a/web/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php +++ b/web/core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php @@ -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,