diff --git a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php index 375f8af26e..ca5a51326f 100644 --- a/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php @@ -71,9 +71,9 @@ class MigrateUpgradeForm extends ConfirmFormBase { /** * List of extensions that do not need an upgrade path. * - * This property is an array where the keys are the version of Drupal from - * which we are upgrading and the values are arrays of extensions that do not - * need an upgrade path. + * This property is an array where the keys are the major Drupal core version + * from which we are upgrading, and the values are arrays of extension names + * that do not need an upgrade path. * * @var array[] */ @@ -759,6 +759,8 @@ public function buildConfirmForm(array $form, FormStateInterface $form_state) { // Get the source_module and destination_module from the field plugins. $definitions = $this->fieldPluginManager->getDefinitions(); foreach ($definitions as $definition) { + // This is not strict so that we find field plugins with an annotation + // where the Drupal core version is an integer and when it is a string. if (in_array($version, $definition['core'])) { $source_module = $definition['source_module']; $destination_module = $definition['destination_module']; diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php index 8ffe6a5d97..f8706ff6d3 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php @@ -7,7 +7,7 @@ use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait; /** - * Provides a base class for testing migration upgrades in the UI. + * Provides a base class for testing a complete upgrade via the UI. */ abstract class MigrateUpgradeExecuteTestBase extends MigrateUpgradeTestBase { diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php index 615c78c6fa..2c927dff18 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php @@ -4,9 +4,10 @@ use Drupal\migrate_drupal\MigrationConfigurationTrait; use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait; +use Drupal\Tests\WebAssert; /** - * Provides a base class for testing the Upgrade review page. + * Provides a base class for testing the review step of the Upgrade form. */ abstract class MigrateUpgradeReviewPageTestBase extends MigrateUpgradeTestBase { @@ -14,9 +15,7 @@ use CreateTestContentEntitiesTrait; /** - * Modules to enable. - * - * @var array + * {@inheritdoc} */ public static $modules = [ 'language', @@ -37,15 +36,17 @@ * * 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 Drupal 6 and Drupal 7 modules - * that have moved to core, ie Views, and for modules that were in Drupal 6 or - * Drupal 7 core but are not in Drupal 8 core, ie 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 listed in the - * noUpgradePath is correct, because there will be no migrations with a - * source_module declared for that module. It is assumed that the modules in - * the test fixtures include all modules that have moved to or dropped from - * core. + * 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 listed in the + * the $noUpgradePath property of the update form class are correct, 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. @@ -79,7 +80,7 @@ public function testMigrateUpgradeReviewPage() { } $edits = $this->translatePostValues($edit); - // Enable all modules in the source except test and example modules but + // Enable all modules in the source except test and example modules, but // include simpletest. /** @var \Drupal\Core\Database\Query\SelectInterface $update */ $update = $this->sourceDatabase->update('system') diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php index c17639cfc6..170a72505d 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php @@ -6,7 +6,7 @@ use Drupal\migrate_drupal\MigrationConfigurationTrait; use Drupal\Tests\BrowserTestBase; use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait; - +use Drupal\Tests\WebAssert; /** * Provides a base class for testing migration upgrades in the UI. */ @@ -127,7 +127,7 @@ protected function translatePostValues(array $values) { * @param array $missing_paths * An array of modules that will not be upgraded. */ - protected function assertUpgradePaths($session, $available_paths, $missing_paths) { + protected function assertUpgradePaths(WebAssert $session, array $available_paths, array $missing_paths) { // Test the available migration paths. foreach ($available_paths as $available) { $session->elementExists('xpath', "//span[contains(@class, 'checked') and text() = '$available']"); diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php index 71fd1cb748..ddcbc713e7 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php @@ -7,6 +7,7 @@ /** * Tests migrate upgrade review page for Drupal 6. * + * @group migrate_drupal_6 * @group migrate_drupal_ui */ class MigrateUpgrade6ReviewPageTest extends MigrateUpgradeReviewPageTestBase { @@ -66,7 +67,8 @@ protected function getAvailablePaths() { 'upload', 'user', 'userreference', - // Modules that have no upgrade path. + // Include modules that do not have an upgrade path, defined in the + // $noUpgradePath property in MigrateUpgradeForm. 'blog', 'blogapi', 'calendarsignup', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php index dd94991291..d6ffe92355 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6Test.php @@ -133,7 +133,9 @@ protected function getAvailablePaths() { 'upload', 'user', 'userreference', - // Modules that have no upgrade path. + // Include modules that do not have an upgrade path and are enabled in the + // source database, defined in the $noUpgradePath property + // in MigrateUpgradeForm. 'date_api', 'date_timezone', 'i18n', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php index 4cd8abbee3..2c2181aad2 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php @@ -7,6 +7,7 @@ /** * Tests migrate upgrade review page for Drupal 7. * + * @group migrate_drupal_7 * @group migrate_drupal_ui */ class MigrateUpgrade7ReviewPageTest extends MigrateUpgradeReviewPageTestBase { @@ -65,7 +66,8 @@ protected function getAvailablePaths() { 'tracker', 'update', 'user', - // Modules that have no upgrade path. + // Include modules that do not have an upgrade path, defined in the + // $noUpgradePath property in MigrateUpgradeForm. 'blog', 'book', 'bulk_export', diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php index 4450ee141b..9432f1db8f 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7Test.php @@ -136,7 +136,9 @@ protected function getAvailablePaths() { 'taxonomy', 'text', 'user', - // Modules that have no upgrade path. + // Include modules that do not have an upgrade path and are enabled in the + // source database, defined in the $noUpgradePath property + // in MigrateUpgradeForm. 'blog', 'contextual', 'date_api',