protected function DrupalWebTestCase::drupalGetMails in SimpleTest 7
Same name and namespace in other branches
- 6.2 drupal_web_test_case.php \DrupalWebTestCase::drupalGetMails()
- 7.2 drupal_web_test_case.php \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.
1 call to DrupalWebTestCase::drupalGetMails()
- SimpleTestMailCaptureTestCase::testMailSend in ./
simpletest.test - Test to see if the wrapper function is executed correctly.
File
- ./
drupal_web_test_case.php, line 1936
Class
- DrupalWebTestCase
- Test case for typical Drupal tests.
Code
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;
}