protected function DrupalWebTestCase::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.

16 calls to DrupalWebTestCase::drupalGetMails()
ContactSitewideTestCase::testAutoReply in drupal-7.x/modules/contact/contact.test
Tests auto-reply on the site-wide contact form.
ContactSitewideTestCase::testAutoReply in drupal-7.x/modules/contact/contact.test
Tests auto-reply on the site-wide contact form.
DrupalWebTestCase::assertMailPattern in drupal-7.x/modules/simpletest/drupal_web_test_case.php
Asserts that the most recently sent e-mail message has the pattern in it.
DrupalWebTestCase::assertMailPattern in drupal-7.x/modules/simpletest/drupal_web_test_case.php
Asserts that the most recently sent e-mail message has the pattern in it.
DrupalWebTestCase::assertMailString in drupal-7.x/modules/simpletest/drupal_web_test_case.php
Asserts that the most recently sent e-mail message has the string in it.

... See full list

Archivo

drupal-7.x/modules/simpletest/drupal_web_test_case.php, line 2825

Class

DrupalWebTestCase
Test case for typical Drupal tests.

Código

protected function drupalGetMails($filter = array()) {
  $captured_emails = variable_get('drupal_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;
}