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.
use FileSystemModuleDiscoveryDataProviderTrait;
use CreateTestContentEntitiesTrait;
+ use ContentModerationTestTrait;
/**
* {@inheritdoc}
$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();
}
$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,
'd7_node_revision',
'd7_taxonomy_term',
'd7_user',
+ 'node_translation_menu_links',
];
$this->assertEmpty(array_diff(array_filter($conflicts), $expected));
}
$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,