Verified Commit 626e487a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3322986 by mondrake: Missed removing a $group parameter from AssertMailTrait

(cherry picked from commit e10d708d)
parent 7cf93d5f
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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.