public function MigrateDrupal7AuditIdsTest::testNodeGrantsIdConflicts in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7AuditIdsTest::testNodeGrantsIdConflicts()
Tests ID conflicts for inaccessible nodes.
File
- core/
modules/ migrate_drupal/ tests/ src/ Kernel/ d7/ MigrateDrupal7AuditIdsTest.php, line 187
Class
- MigrateDrupal7AuditIdsTest
- Tests the migration auditor for ID conflicts.
Namespace
Drupal\Tests\migrate_drupal\Kernel\d7Code
public function testNodeGrantsIdConflicts() {
// Enable the node_test module to restrict access to page nodes.
$this
->enableModules([
'node_test',
]);
// Create a published node of type page.
$node = Node::create([
'type' => 'page',
'title' => 'foo',
]);
$node->moderation_state->value = 'published';
$node
->save();
// Audit the IDs of the d7_node migration. There should be conflicts
// even though the new node is not accessible.
/** @var \Drupal\migrate\Audit\AuditResult $result */
$result = (new IdAuditor())
->audit($this
->getMigration('d7_node:page'));
$this
->assertInstanceOf(AuditResult::class, $result);
$this
->assertFalse($result
->passed());
}