1 backdrop_web_test_case.php | protected BackdropWebTestCase::backdropGetMails($filter = array()) |
Gets an array containing all emails sent during this test case.
Parameters
$filter: An array containing key/value pairs used to filter the emails that are returned.
Return value
An array containing email messages captured during the current test.:
File
- core/
modules/ simpletest/ backdrop_web_test_case.php, line 3150
Class
- BackdropWebTestCase
- Test case for typical Backdrop tests.
Code
protected function backdropGetMails($filter = array()) {
$captured_emails = state_get('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;
}