You are here

public function MigrateDrupal6AuditIdsTest::testAllMigrationsWithNoIdConflicts in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6AuditIdsTest::testAllMigrationsWithNoIdConflicts()

Tests all migrations with no ID conflicts.

File

core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php, line 94

Class

MigrateDrupal6AuditIdsTest
Tests the migration auditor for ID conflicts.

Namespace

Drupal\Tests\migrate_drupal\Kernel\d6

Code

public function testAllMigrationsWithNoIdConflicts() {
  $migrations = $this->container
    ->get('plugin.manager.migration')
    ->createInstancesByTag('Drupal 6');

  // Audit all Drupal 6 migrations that support it. There should be no
  // conflicts since no content has been created.
  $results = (new IdAuditor())
    ->auditMultiple($migrations);

  /** @var \Drupal\migrate\Audit\AuditResult $result */
  foreach ($results as $result) {
    $this
      ->assertInstanceOf(AuditResult::class, $result);
    $this
      ->assertTrue($result
      ->passed());
  }
}