protected function MigrateUpgradeTestBase::assertReviewForm in Drupal 10
Same name and namespace in other branches
- 9 core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase::assertReviewForm()
Helper to assert content on the Review form.
Parameters
array|null $available_paths: An array of modules that will be upgraded. Defaults to $this->getAvailablePaths().
array|null $missing_paths: An array of modules that will not be upgraded. Defaults to $this->getMissingPaths().
Throws
\Behat\Mink\Exception\ExpectationException
1 call to MigrateUpgradeTestBase::assertReviewForm()
- Upgrade7Test::testUpgrade in core/
modules/ rdf/ tests/ src/ Functional/ Migrate/ Upgrade7Test.php - Executes all steps of migrations upgrade.
File
- core/
modules/ migrate_drupal_ui/ tests/ src/ Functional/ MigrateUpgradeTestBase.php, line 206
Class
- MigrateUpgradeTestBase
- Provides a base class for testing migration upgrades in the UI.
Namespace
Drupal\Tests\migrate_drupal_ui\FunctionalCode
protected function assertReviewForm(array $available_paths = NULL, array $missing_paths = NULL) {
$session = $this
->assertSession();
$session
->pageTextContains('What will be upgraded?');
$available_paths = $available_paths ?? $this
->getAvailablePaths();
$missing_paths = $missing_paths ?? $this
->getMissingPaths();
// Test the available migration paths.
foreach ($available_paths as $available) {
$session
->elementExists('xpath', "//td[contains(@class, 'checked') and text() = '{$available}']");
$session
->elementNotExists('xpath', "//td[contains(@class, 'error') and text() = '{$available}']");
}
// Test the missing migration paths.
foreach ($missing_paths as $missing) {
$session
->elementExists('xpath', "//td[contains(@class, 'error') and text() = '{$missing}']");
$session
->elementNotExists('xpath', "//td[contains(@class, 'checked') and text() = '{$missing}']");
}
// Test the total count of missing and available paths.
$session
->elementsCount('xpath', "//td[contains(@class, 'upgrade-analysis-report__status-icon--error')]", count($missing_paths));
$session
->elementsCount('xpath', "//td[contains(@class, 'upgrade-analysis-report__status-icon--checked')]", count($available_paths));
}