X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fconfig%2Ftests%2Fsrc%2FFunctional%2FConfigImportUITest.php;fp=web%2Fcore%2Fmodules%2Fconfig%2Ftests%2Fsrc%2FFunctional%2FConfigImportUITest.php;h=715976d1622e8dc60b38a09fe0fcb515954a4c68;hp=fd76990da6120057d6be48c8c0a4e5cbd1f4f4e6;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php index fd76990da..715976d16 100644 --- a/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php +++ b/web/core/modules/config/tests/src/Functional/ConfigImportUITest.php @@ -3,7 +3,7 @@ namespace Drupal\Tests\config\Functional; use Drupal\Component\Utility\Html; -use Drupal\Component\Utility\SafeMarkup; +use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Config\InstallStorage; use Drupal\Tests\BrowserTestBase; @@ -433,7 +433,7 @@ class ConfigImportUITest extends BrowserTestBase { // Attempt to import configuration and verify that an error message appears. $this->drupalPostForm(NULL, [], t('Import all')); - $this->assertText(SafeMarkup::format('Deleted and replaced configuration entity "@name"', ['@name' => $name_secondary])); + $this->assertText(new FormattableMarkup('Deleted and replaced configuration entity "@name"', ['@name' => $name_secondary])); $this->assertText(t('The configuration was imported with errors.')); $this->assertNoText(t('The configuration was imported successfully.')); $this->assertText(t('There are no configuration changes to import.')); @@ -518,4 +518,17 @@ class ConfigImportUITest extends BrowserTestBase { $this->assertText('Unable to install the does_not_exist theme since it does not exist.'); } + /** + * Tests that errors set in the batch and on the ConfigImporter are merged. + */ + public function testBatchErrors() { + $new_site_name = 'Config import test ' . $this->randomString(); + $this->prepareSiteNameUpdate($new_site_name); + \Drupal::state()->set('config_import_steps_alter.error', TRUE); + $this->drupalPostForm('admin/config/development/configuration', [], t('Import all')); + $this->assertSession()->responseContains('_config_import_test_config_import_steps_alter batch error'); + $this->assertSession()->responseContains('_config_import_test_config_import_steps_alter ConfigImporter error'); + $this->assertSession()->responseContains('The configuration was imported with errors.'); + } + }