You are here

public function MigrateDrupal7AuditIdsTest::testAllMigrationsWithNoIdConflicts in Drupal 9

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

Tests all migrations with no ID conflicts.

File

core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php, line 94

Class

MigrateDrupal7AuditIdsTest
Tests the migration auditor for ID conflicts.

Namespace

Drupal\Tests\migrate_drupal\Kernel\d7

Code

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

  // Audit the IDs of all Drupal 7 migrations. 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());
  }
}