function MigrateDrupal6AuditIdsTest::testAllMigrationsWithIdConflicts
Same name in other branches
- 9 core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6AuditIdsTest::testAllMigrationsWithIdConflicts()
- 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6AuditIdsTest::testAllMigrationsWithIdConflicts()
- 11.x core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6AuditIdsTest::testAllMigrationsWithIdConflicts()
Tests all migrations with ID conflicts.
File
-
core/
modules/ migrate_drupal/ tests/ src/ Kernel/ d6/ MigrateDrupal6AuditIdsTest.php, line 121
Class
- MigrateDrupal6AuditIdsTest
- Tests the migration auditor for ID conflicts.
Namespace
Drupal\Tests\migrate_drupal\Kernel\d6Code
public function testAllMigrationsWithIdConflicts() : void {
// Get all Drupal 6 migrations.
$migrations = $this->container
->get('plugin.manager.migration')
->createInstancesByTag('Drupal 6');
// Create content.
$this->createContent();
// Audit the IDs of all migrations. There should be conflicts since content
// has been created.
$conflicts = array_map(function (AuditResult $result) {
return $result->passed() ? NULL : $result->getMigration()
->getBaseId();
}, (new IdAuditor())->auditMultiple($migrations));
$expected = [
'd6_comment',
'd6_custom_block',
'd6_file',
'd6_menu_links',
'd6_node',
'd6_node_complete',
'd6_node_revision',
'd6_taxonomy_term',
'd6_term_node_revision',
'd6_user',
'node_translation_menu_links',
];
$this->assertEmpty(array_diff(array_filter($conflicts), $expected));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.