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 d158de68bf..b886593582 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php @@ -6,7 +6,7 @@ use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait; /** - * Provides a base class for testing the UpgradeReview page. + * Provides a base class for testing the Upgrade review page. */ abstract class MigrateUpgradeReviewPageTestBase extends MigrateUpgradeTestBase { @@ -33,24 +33,20 @@ ]; /** - * {@inheritdoc} - */ - protected function getSourceBasePath() { - return __DIR__ . '/files'; - } - - /** * Tests the migrate upgrade review page. * - * The form displays two types of information, one is error messages for - * migrations that do not have a source_module defined, the other is a list - * of modules and their upgrade status. In this test there should be no error - * messages because the relevant test modules are not installed. The list - * of modules, available and missing, will be complete for all modules - * moved to Drupal 8 core. This is accomplished by modifying the source - * database to enable all modules that do not include 'test' or 'example' in - * their name. This then tests that the noUpgradePath contain a complete list - * of modules moved from previous versions of Drupal to Drupal 8. + * The upgrade review form displays two types of information, one is possible + * error messages for migrations that do not have a source_module defined and + * the other is a list of modules and their upgrade status. In this test, + * there should be no errors displayed of the first type because the relevant + * test modules are not installed. The second type of information, the list + * of modules and their upgrade status, is tested with all the modules in the + * source test fixture enabled, except test and example modules, but including + * simpletest. The test fixture is assumed to have the modules that have since + * moved to Drupal 8 core. This is done to test that the noUpgradePath array + * defined in MigrateUpgradeForm contains a complete list of modules moved + * from previous versions of Drupal to Drupal 8 and that the modules are + * displayed in the correct list, either the available or missing list. * * Note that this assumption here is that the Drupal 6 and Drupal 7 test * fixtures include all modules that have moved to Drupal 8 core. @@ -82,18 +78,20 @@ public function testMigrateUpgradeReviewPage() { } $edits = $this->translatePostValues($edit); - // Enable all modules in the source. - $this->sourceDatabase->update('system') + // 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') ->fields(['status' => 1]) - ->condition('type', 'module') + ->condition('type', 'module'); + $and = $update->andConditionGroup() ->condition('name', '%test%', 'NOT LIKE') - ->condition('name', '%example%', 'NOT LIKE') - ->execute(); - $this->sourceDatabase->update('system') - ->fields(['status' => 1]) - ->condition('type', 'module') - ->condition('name', 'simpletest') - ->execute(); + ->condition('name', '%example%', 'NOT LIKE'); + $conditions = $update->orConditionGroup(); + $conditions->condition($and); + $conditions->condition('name', 'simpletest'); + $update->condition($conditions); + $update->execute(); // Start the upgrade process. $this->drupalGet('/upgrade'); 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 7432288a65..71fd1cb748 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 @@ -22,6 +22,13 @@ protected function setUp() { /** * {@inheritdoc} */ + protected function getSourceBasePath() { + return __DIR__ . '/files'; + } + + /** + * {@inheritdoc} + */ protected function getAvailablePaths() { return [ 'aggregator', 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 215dd88dd9..51b3321dae 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 @@ -8,7 +8,7 @@ /** * Tests Drupal 6 upgrade using the migrate UI. * - * The test method is provided by the MigrateUpgradeTest class. + * The test method is provided by the MigrateUpgradeExecuteTestBase class. * * @group migrate_drupal_ui */ 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 9452c31cf1..4cd8abbee3 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 @@ -22,6 +22,13 @@ protected function setUp() { /** * {@inheritdoc} */ + protected function getSourceBasePath() { + return __DIR__ . '/files'; + } + + /** + * {@inheritdoc} + */ protected function getAvailablePaths() { return [ 'aggregator', 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 5ab7143453..1de7c849ae 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 @@ -8,7 +8,7 @@ /** * Tests Drupal 7 upgrade using the migrate UI. * - * The test method is provided by the MigrateUpgradeTest class. + * The test method is provided by the MigrateUpgradeExecuteTestBase class. * * @group migrate_drupal_ui */