protected function WebTestBase::drupalGetMails

Gets an array containing all e-mails sent during this test case.

Parameters

$filter: An array containing key/value pairs used to filter the e-mails that are returned.

Return value

An array containing e-mail messages captured during the current test.

9 calls to WebTestBase::drupalGetMails()
ContactSitewideTest::testAutoReply in drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
Tests auto-reply on the site-wide contact form.
MailCaptureTest::testMailSend in drupal/core/modules/simpletest/lib/Drupal/simpletest/Tests/MailCaptureTest.php
Test to see if the wrapper function is executed correctly.
OpenIDTestBase::getPasswordResetURLFromMail in drupal/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php
Parses the last sent e-mail and returns the one-time login link URL.
SiteMaintenanceTest::testSiteMaintenance in drupal/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php
Verify site maintenance mode functionality.
StatisticsAdminTest::testDeleteUser in drupal/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php
Tests that accesslog reflects when a user is deleted.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 2021
Definition of Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function drupalGetMails($filter = array()) {
  $captured_emails = state()
    ->get('system.test_email_collector') ?: array();
  $filtered_emails = array();
  foreach ($captured_emails as $message) {
    foreach ($filter as $key => $value) {
      if (!isset($message[$key]) || $message[$key] != $value) {
        continue 2;
      }
    }
    $filtered_emails[] = $message;
  }
  return $filtered_emails;
}