only in patch2: unchanged: --- a/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php +++ b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php @@ -30,7 +30,7 @@ * * @var array */ - public static $modules = ['language', 'content_translation', 'migrate_drupal_ui', 'telephone']; + public static $modules = ['language', 'content_translation', 'migrate_drupal_ui', 'telephone', 'provider_test']; /** * {@inheritdoc} @@ -135,6 +135,29 @@ public function testMigrateUpgrade() { $this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->assertResponse(200); $this->assertText('Are you sure?'); + // Ensure we get errors about missing providers. + $this->assertText(t('Source provider not found for provider_no_annotation.')); + $this->assertText(t(' Source provider not found for provider_test.')); + $this->assertText(t('Destination provider not found for provider_test')); + + // Uninstall the module causing the missing provider error messages. + $this->container->get('module_installer')->uninstall(['provider_test'], TRUE); + + // Restart the upgrade process. + $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->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('Are you sure?'); + // Ensure there are no errors about the missing providers. + $this->assertNoText(t('Source provider not found for provider_no_annotation.')); + $this->assertNoText(t(' Source provider not found for provider_test.')); + $this->assertNoText(t('Destination provider not found for provider_test')); $this->drupalPostForm(NULL, [], t('Perform upgrade')); $this->assertText(t('Congratulations, you upgraded Drupal!')); only in patch2: unchanged: --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_no_annotation.yml @@ -0,0 +1,13 @@ +id: provider_no_annotation +label: Missing source annotation +migration_tags: + - Drupal 6 + - Drupal 7 +source: +# Test plugin without a source_provider annotation + plugin: no_source_provider +process: + message: site_offline_message +destination: + plugin: config + config_name: test.settings only in patch2: unchanged: --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/migration_templates/provider_test.yml @@ -0,0 +1,16 @@ +id: provider_test +label: Missing source and destination provider +migration_tags: + - Drupal 6 + - Drupal 7 +source: + plugin: variable + variables: + - site_offline_message +# Do not add a provider for the test. +process: + message: site_offline_message +destination: + plugin: config +# An empty config_name will not have a destination provider. + config_name: only in patch2: unchanged: --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/provider_test.info.yml @@ -0,0 +1,6 @@ +name: 'Provider missing' +type: module +description: 'Add a migration missing a source and destination and a source plugin missing a source provide.' +package: Testing +version: VERSION +core: 8.x only in patch2: unchanged: --- /dev/null +++ b/core/modules/migrate_drupal_ui/tests/modules/provider_test/src/Plugin/migrate/source/NoSourceProvider.php @@ -0,0 +1,31 @@ +