Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / migrate_drupal_ui / src / Tests / MigrateUpgradeTestBase.php
index 4aea3f1d093b5b8ebe3d2582815682befbae465b..e39adee22f2ab60514c583a5f1229d3bd0587f70 100644 (file)
@@ -20,6 +20,8 @@ abstract class MigrateUpgradeTestBase extends WebTestBase {
 
   /**
    * Use the Standard profile to test help implementations of many core modules.
+   *
+   * @var string
    */
   protected $profile = 'standard';
 
@@ -44,6 +46,7 @@ abstract class MigrateUpgradeTestBase extends WebTestBase {
     'book',
     'forum',
     'statistics',
+    'modules_available_test',
   ];
 
   /**
@@ -118,7 +121,7 @@ abstract class MigrateUpgradeTestBase extends WebTestBase {
   public function testMigrateUpgrade() {
     $connection_options = $this->sourceDatabase->getConnectionOptions();
     $this->drupalGet('/upgrade');
-    $this->assertText('Upgrade a site by importing it into a clean and empty new install of Drupal 8. You will lose any existing configuration once you import your site into it. See the online documentation for Drupal site upgrades for more detailed information.');
+    $this->assertText('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8.');
 
     $this->drupalPostForm(NULL, [], t('Continue'));
     $this->assertText('Provide credentials for the database of the Drupal site you want to upgrade.');
@@ -148,7 +151,31 @@ abstract class MigrateUpgradeTestBase extends WebTestBase {
 
     $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
     $this->assertResponse(200);
-    $this->assertText('Are you sure?');
+    $this->assertText('Upgrade analysis report');
+    // Ensure we get errors about missing modules.
+    $this->assertText(t('Source module not found for module_no_annotation.'));
+    $this->assertText(t('Source module not found for modules_available_test.'));
+    $this->assertText(t('Destination module not found for modules_available_test'));
+
+    // Uninstall the module causing the missing module error messages.
+    $this->container->get('module_installer')->uninstall(['modules_available_test'], TRUE);
+
+    // Restart the upgrade process.
+    $this->drupalGet('/upgrade');
+    $this->assertText('Upgrade a site by importing its database and files into a clean and empty new install of Drupal 8.');
+
+    $this->drupalPostForm(NULL, [], t('Continue'));
+    $this->assertText('Provide credentials for the database of the Drupal site you want to upgrade.');
+    $this->assertFieldByName('mysql[host]');
+
+    $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
+    $this->assertResponse(200);
+    $this->assertText('Upgrade analysis report');
+    // Ensure there are no errors about the missing modules.
+    $this->assertNoText(t('Source module not found for module_no_annotation.'));
+    $this->assertNoText(t('Source module not found for modules_available_test.'));
+    $this->assertNoText(t('Destination module not found for modules_available_test'));
+    // Check for any missing module errors.
     $this->drupalPostForm(NULL, [], t('Perform upgrade'));
     $this->assertText(t('Congratulations, you upgraded Drupal!'));