protected function MaillogTestCase::getAllMaillogEntries in Maillog / Mail Developer 7
Gets all Maillog entries.
Return value
array A list of Maillog entries.
1 call to MaillogTestCase::getAllMaillogEntries()
- MaillogTestCase::testDeletePageSecurity in tests/
MaillogTestCase.test - Confirm that the 'delete' pages are not able to delete messages.
File
- tests/
MaillogTestCase.test, line 268 - Unit-ish tests for the Maillog module.
Class
- MaillogTestCase
- All unit tests for the module.
Code
protected function getAllMaillogEntries() {
$query = 'SELECT id, header_from, header_to, header_reply_to, header_all, subject, body FROM {maillog} ORDER BY id ASC';
$results = db_query($query);
$messages = array();
if (!empty($results)) {
while ($message = $results
->fetchAssoc()) {
// Unserialize values.
$this
->verbose($message);
$message['header_all'] = unserialize($message['header_all']);
$messages[] = $message;
}
}
return $messages;
}