function MigrateUpgradeTestBase::assertReviewForm

Same name in other branches
  1. 9 core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeTestBase::assertReviewForm()
  2. 11.x 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

7 calls to MigrateUpgradeTestBase::assertReviewForm()
MigrateUpgradeExecuteTestBase::doUpgradeAndIncremental in core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php
Executes an upgrade and then an incremental upgrade.
MultilingualReviewPageTestBase::testMigrateUpgradeReviewPage in core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
Tests the migrate upgrade review form.
NoMultilingualReviewPageTestBase::testMigrateUpgradeReviewPage in core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php
Tests the review page when content_translation is enabled.
Upgrade6Test::testUpgrade in core/modules/forum/tests/src/Functional/migrate_drupal/d6/Upgrade6Test.php
Executes all steps of migrations upgrade.
Upgrade7Test::testUpgrade in core/modules/forum/tests/src/Functional/migrate_drupal/d7/Upgrade7Test.php
Executes all steps of migrations upgrade.

... See full list

File

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

Class

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

Namespace

Drupal\Tests\migrate_drupal_ui\Functional

Code

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));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.