diff --git a/core/lib/Drupal/Core/Mail/MailFactory.php b/core/lib/Drupal/Core/Mail/MailFactory.php index d6bef9f717c..dc1b70621f3 100644 --- a/core/lib/Drupal/Core/Mail/MailFactory.php +++ b/core/lib/Drupal/Core/Mail/MailFactory.php @@ -62,7 +62,7 @@ class MailFactory { * @code * array( * 'default' => 'Drupal\Core\Mail\PhpMail', - * 'user' => 'DevelMailLog', + * 'user' => 'Drupal\devel\DevelMailLog', * ); * @endcode * @@ -72,8 +72,8 @@ class MailFactory { * @code * array( * 'default' => 'Drupal\Core\Mail\PhpMail', - * 'user' => 'DevelMailLog', - * 'contact_page_autoreply' => 'DrupalDevNullMailSend', + * 'user' => 'Drupal\devel\DevelMailLog', + * 'contact_page_autoreply' => 'Drupal\example\NullMail', * ); * @endcode * diff --git a/core/lib/Drupal/Core/Mail/TestMailCollector.php b/core/lib/Drupal/Core/Mail/TestMailCollector.php new file mode 100644 index 00000000000..3b3e0566e64 --- /dev/null +++ b/core/lib/Drupal/Core/Mail/TestMailCollector.php @@ -0,0 +1,30 @@ +get('system.test_mail_collector') ?: array(); + $captured_emails[] = $message; + \Drupal::state()->set('system.test_mail_collector', $captured_emails); + + return TRUE; + } +} diff --git a/core/lib/Drupal/Core/Mail/VariableLog.php b/core/lib/Drupal/Core/Mail/VariableLog.php deleted file mode 100644 index c7b52013c5c..00000000000 --- a/core/lib/Drupal/Core/Mail/VariableLog.php +++ /dev/null @@ -1,30 +0,0 @@ -get('system.test_email_collector') ?: array(); - $captured_emails[] = $message; - \Drupal::state()->set('system.test_email_collector', $captured_emails); - - return TRUE; - } -} diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 2f794b2efd6..9e7b6b2a26d 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -1075,7 +1075,7 @@ abstract class TestBase { drupal_static_reset(); if ($this->container->has('state') && $state = $this->container->get('state')) { - $captured_emails = $state->get('system.test_email_collector') ?: array(); + $captured_emails = $state->get('system.test_mail_collector') ?: array(); $emailCount = count($captured_emails); if ($emailCount) { $message = format_plural($emailCount, '1 e-mail was sent during this test.', '@count e-mails were sent during this test.'); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 7541fb26af3..265012e465b 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -844,7 +844,7 @@ abstract class WebTestBase extends TestBase { } // Use the test mail class instead of the default mail handler class. - \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\TestMailCollector')->save(); drupal_set_time_limit($this->timeLimit); // Temporary fix so that when running from run-tests.sh we don't get an @@ -2452,7 +2452,7 @@ abstract class WebTestBase extends TestBase { * An array containing e-mail messages captured during the current test. */ protected function drupalGetMails($filter = array()) { - $captured_emails = \Drupal::state()->get('system.test_email_collector') ?: array(); + $captured_emails = \Drupal::state()->get('system.test_mail_collector') ?: array(); $filtered_emails = array(); foreach ($captured_emails as $message) { @@ -3449,7 +3449,7 @@ abstract class WebTestBase extends TestBase { * TRUE on pass, FALSE on fail. */ protected function assertMail($name, $value = '', $message = '', $group = 'E-mail') { - $captured_emails = \Drupal::state()->get('system.test_email_collector') ?: array(); + $captured_emails = \Drupal::state()->get('system.test_mail_collector') ?: array(); $email = end($captured_emails); return $this->assertTrue($email && isset($email[$name]) && $email[$name] == $value, $message, $group); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php index addfc9e52d3..69b3352bc54 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php @@ -132,7 +132,7 @@ class InstallerTranslationTest extends InstallerTest { ), $submit_value); // Use the test mail class instead of the default mail handler class. - \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\TestMailCollector')->save(); drupal_set_time_limit($this->timeLimit); // When running from run-tests.sh we don't get an empty current path which diff --git a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php index cda353781ea..5bbaab86581 100644 --- a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php @@ -96,7 +96,7 @@ class InstallerTest extends WebTestBase { } // Use the test mail class instead of the default mail handler class. - \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); + \Drupal::config('system.mail')->set('interface.default', 'Drupal\Core\Mail\TestMailCollector')->save(); drupal_set_time_limit($this->timeLimit); // When running from run-tests.sh we don't get an empty current path which