Loading core/lib/Drupal/Core/Test/AssertMailTrait.php +1 −6 Original line number Diff line number Diff line Loading @@ -50,16 +50,11 @@ protected function getMails(array $filter = []) { * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * @param string $group * (optional) The group this message is in, which is displayed in a column * in test output. Use 'Debug' to indicate this is debugging output. Do not * translate this string. Defaults to 'Email'; most tests do not override * this default. * * @return bool * TRUE on pass. */ protected function assertMail($name, $value = '', $message = '', $group = 'Email') { protected function assertMail($name, $value = '', $message = '') { $captured_emails = $this->container->get('state')->get('system.test_mail_collector') ?: []; $email = end($captured_emails); $this->assertIsArray($email, $message); Loading core/tests/Drupal/FunctionalTests/MailCaptureTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public function testMailSend() { // Assert that the email was sent by iterating over the message properties // and ensuring that they are captured intact. foreach ($message as $field => $value) { $this->assertMail($field, $value, new FormattableMarkup('The email was sent and the value for property @field is intact.', ['@field' => $field]), 'Email'); $this->assertMail($field, $value, new FormattableMarkup('The email was sent and the value for property @field is intact.', ['@field' => $field])); } // Send additional emails so more than one email is captured. Loading Loading
core/lib/Drupal/Core/Test/AssertMailTrait.php +1 −6 Original line number Diff line number Diff line Loading @@ -50,16 +50,11 @@ protected function getMails(array $filter = []) { * messages: use \Drupal\Component\Render\FormattableMarkup to embed * variables in the message text, not t(). If left blank, a default message * will be displayed. * @param string $group * (optional) The group this message is in, which is displayed in a column * in test output. Use 'Debug' to indicate this is debugging output. Do not * translate this string. Defaults to 'Email'; most tests do not override * this default. * * @return bool * TRUE on pass. */ protected function assertMail($name, $value = '', $message = '', $group = 'Email') { protected function assertMail($name, $value = '', $message = '') { $captured_emails = $this->container->get('state')->get('system.test_mail_collector') ?: []; $email = end($captured_emails); $this->assertIsArray($email, $message); Loading
core/tests/Drupal/FunctionalTests/MailCaptureTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public function testMailSend() { // Assert that the email was sent by iterating over the message properties // and ensuring that they are captured intact. foreach ($message as $field => $value) { $this->assertMail($field, $value, new FormattableMarkup('The email was sent and the value for property @field is intact.', ['@field' => $field]), 'Email'); $this->assertMail($field, $value, new FormattableMarkup('The email was sent and the value for property @field is intact.', ['@field' => $field])); } // Send additional emails so more than one email is captured. Loading