You are here

protected function MigrateUpgradeTestBase::assertIdConflictForm in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase::assertIdConflictForm()

Helper method that asserts text on the ID conflict form.

Parameters

array $entity_types: An array of entity types.

Throws

\Behat\Mink\Exception\ResponseTextException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php, line 178

Class

MigrateUpgradeTestBase
Provides a base class for testing migration upgrades in the UI.

Namespace

Drupal\Tests\migrate_drupal_ui\Functional

Code

protected function assertIdConflictForm(array $entity_types) {
  $session = $this
    ->assertSession();

  /** @var \Drupal\Core\Entity\EntityTypeManager $entity_type_manager */
  $entity_type_manager = \Drupal::service('entity_type.manager');
  $session
    ->pageTextContains('WARNING: Content may be overwritten on your new site.');
  $session
    ->pageTextContains('There is conflicting content of these types:');
  $this
    ->assertNotEmpty($entity_types);
  foreach ($entity_types as $entity_type) {
    $label = $entity_type_manager
      ->getDefinition($entity_type)
      ->getPluralLabel();
    $session
      ->pageTextContains($label);
  }
  $session
    ->pageTextContainsOnce('content items');
  $session
    ->pageTextContains('There is translated content of these types:');
}