public function MultilingualReviewPageTestBase::testMigrateUpgradeReviewPage in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MultilingualReviewPageTestBase::testMigrateUpgradeReviewPage()
- 10 core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php \Drupal\Tests\migrate_drupal_ui\Functional\MultilingualReviewPageTestBase::testMigrateUpgradeReviewPage()
Tests the migrate upgrade review form.
The upgrade review form displays a list of modules that will be upgraded and a list of modules that will not be upgraded. This test is to ensure that the review page works correctly for all contributed Drupal 6 and Drupal 7 modules that have moved to core, e.g. Views, and for modules that were in Drupal 6 or Drupal 7 core but are not in Drupal 8 core, e.g. Overlay.
To do this all modules in the source fixtures are enabled, except test and example modules. This means that we can test that the modules that do not need any migrations, such as Overlay, since there will be no available migrations which declare those modules as their source_module. It is assumed that the test fixtures include all modules that have moved to or dropped from core.
The upgrade review form will also display errors for each migration that does not have a source_module definition. That function is not tested here.
See also
\Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase
1 method overrides MultilingualReviewPageTestBase::testMigrateUpgradeReviewPage()
- NoMultilingualReviewPageTestBase::testMigrateUpgradeReviewPage in core/
modules/ migrate_drupal_ui/ tests/ src/ Functional/ NoMultilingualReviewPageTestBase.php - Tests the review page when content_translation is enabled.
File
- core/
modules/ migrate_drupal_ui/ tests/ src/ Functional/ MultilingualReviewPageTestBase.php, line 50
Class
- MultilingualReviewPageTestBase
- Provides a base class for testing the review step of the Upgrade form.
Namespace
Drupal\Tests\migrate_drupal_ui\FunctionalCode
public function testMigrateUpgradeReviewPage() {
$this
->prepare();
// Start the upgrade process.
$this
->drupalGet('/upgrade');
$this
->drupalPostForm(NULL, [], t('Continue'));
$this
->drupalPostForm(NULL, $this->edits, t('Review upgrade'));
$this
->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
// Ensure there are no errors about missing modules from the test module.
$session = $this
->assertSession();
$session
->pageTextNotContains(t('Source module not found for migration_provider_no_annotation.'));
$session
->pageTextNotContains(t('Source module not found for migration_provider_test.'));
$session
->pageTextNotContains(t('Destination module not found for migration_provider_test'));
// Ensure there are no errors about any other missing migration providers.
$session
->pageTextNotContains(t('module not found'));
// Test the upgrade paths.
$available_paths = $this
->getAvailablePaths();
$missing_paths = $this
->getMissingPaths();
$this
->assertUpgradePaths($session, $available_paths, $missing_paths);
// Check there are no errors when a module does not have any migrations and
// does not need any. Test with a module that is in both Drupal 6 and
// Drupal 7 core.
$module = 'help';
$query = $this->sourceDatabase
->delete('system');
$query
->condition('type', 'module');
$query
->condition('name', $module);
$query
->execute();
// Start the upgrade process.
$this
->drupalGet('/upgrade');
$this
->drupalPostForm(NULL, [], t('Continue'));
$this
->drupalPostForm(NULL, $this->edits, t('Review upgrade'));
$this
->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
// Test the upgrade paths. First remove the module from the available paths
// list.
$available_paths = $this
->getAvailablePaths();
$available_paths = array_diff($available_paths, [
$module,
]);
$missing_paths = $this
->getMissingPaths();
$this
->assertUpgradePaths($session, $available_paths, $missing_paths);
}