Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / migrate_drupal_ui / tests / src / Functional / MigrateUpgradeExecuteTestBase.php
index 36925d2b84b59581e3b68146644389503277e04b..fc9529ee40132d56200dd517e91a5da7bf312c5f 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\migrate_drupal_ui\Functional;
 
-use Drupal\migrate_drupal\MigrationConfigurationTrait;
 use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait;
 
 /**
@@ -10,7 +9,6 @@ use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait;
  */
 abstract class MigrateUpgradeExecuteTestBase extends MigrateUpgradeTestBase {
 
-  use MigrationConfigurationTrait;
   use CreateTestContentEntitiesTrait;
 
   /**
@@ -70,16 +68,35 @@ abstract class MigrateUpgradeExecuteTestBase extends MigrateUpgradeTestBase {
     // Ensure submitting the form with invalid database credentials gives us a
     // nice warning.
     $this->drupalPostForm(NULL, [$driver . '[database]' => 'wrong'] + $edits, t('Review upgrade'));
-    $session->pageTextContains('Resolve the issue below to continue the upgrade.');
+    $session->pageTextContains('Resolve all issues below to continue the upgrade.');
 
     $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
     // Ensure we get errors about missing modules.
-    $session->pageTextContains(t('Resolve the issue below to continue the upgrade'));
+    $session->pageTextContains(t('Resolve all issues below to continue the upgrade.'));
     $session->pageTextContains(t('The no_source_module plugin must define the source_module property.'));
 
     // Uninstall the module causing the missing module error messages.
     $this->container->get('module_installer')->uninstall(['migration_provider_test'], TRUE);
 
+    // Test the file sources.
+    $this->drupalGet('/upgrade');
+    $this->drupalPostForm(NULL, [], t('Continue'));
+    if ($version == 6) {
+      $paths['d6_source_base_path'] = DRUPAL_ROOT . '/wrong-path';
+    }
+    else {
+      $paths['source_base_path'] = 'https://example.com/wrong-path';
+      $paths['source_private_file_path'] = DRUPAL_ROOT . '/wrong-path';
+    }
+    $this->drupalPostForm(NULL, $paths + $edits, t('Review upgrade'));
+    if ($version == 6) {
+      $session->responseContains('Unable to read from Files directory.');
+    }
+    else {
+      $session->responseContains('Unable to read from Public files directory.');
+      $session->responseContains('Unable to read from Private files directory.');
+    }
+
     // Restart the upgrade process.
     $this->drupalGet('/upgrade');
     $session->responseContains('Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal 8.');
@@ -121,7 +138,7 @@ abstract class MigrateUpgradeExecuteTestBase extends MigrateUpgradeTestBase {
     $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
     $session->pageTextContains('WARNING: Content may be overwritten on your new site.');
     $session->pageTextContains('There is conflicting content of these types:');
-    $session->pageTextContains('file entities');
+    $session->pageTextContains('files');
     $session->pageTextContains('content item revisions');
     $session->pageTextContains('There is translated content of these types:');
     $session->pageTextContains('content items');