diff --git a/core/modules/system/tests/src/Kernel/Mail/MailTest.php b/core/modules/system/tests/src/Kernel/Mail/MailTest.php index 480d0e9..1200e85 100644 --- a/core/modules/system/tests/src/Kernel/Mail/MailTest.php +++ b/core/modules/system/tests/src/Kernel/Mail/MailTest.php @@ -78,7 +78,11 @@ public function testPluggableFramework() { */ public function testErrorMessageDisplay() { // Switch mail backends. - $this->config('system.mail')->set('interface.default', 'test_php_mail_failure')->save(); + // @todo can this be avoided? + // KernelTestBase enforces the usage of 'test_mail_collector' plugin for + // collect the mails. Since we need to test this functionality itself, we + // manually configure the default mail interface. + $GLOBALS['config']['system.mail']['interface']['default'] = 'test_php_mail_failure'; // Test with errors displayed to users. \Drupal::service('plugin.manager.mail')->mail('default', 'default', 'test@example.com', 'en'); @@ -119,8 +123,6 @@ public function testCancelMessage() { public function testFromAndReplyToHeader() { $language = \Drupal::languageManager()->getCurrentLanguage(); - // Use the state system collector mail backend. - $this->config('system.mail')->set('interface.default', 'test_mail_collector')->save(); // Reset the state variable that holds sent messages. \Drupal::state()->set('system.test_mail_collector', []); // Send an email with a reply-to address specified.