protected function MaillogTestCase::getLatestMaillogEntry in Maillog / Mail Developer 7
Gets the latest Maillog entry.
Return value
array Maillog entry.
4 calls to MaillogTestCase::getLatestMaillogEntry()
- MaillogTestCase::testBodyXss in tests/MaillogTestCase.test 
- Confirm that it is not possible to create XSS attacks via an email body.
- MaillogTestCase::testLogging in tests/MaillogTestCase.test 
- Tests logging mail with maillog module.
- MaillogTestCase::testLongSubject in tests/MaillogTestCase.test 
- Confirm what happens with long subject lines.
- MaillogTestCase::testSubjectXss in tests/MaillogTestCase.test 
- Confirm that it is not possible to create XSS attacks via an email subject.
File
- tests/MaillogTestCase.test, line 251 
- Unit-ish tests for the Maillog module.
Class
- MaillogTestCase
- All unit tests for the module.
Code
protected function getLatestMaillogEntry() {
  $query = 'SELECT id, header_from, header_to, header_reply_to, header_all, subject, body FROM {maillog} ORDER BY id DESC';
  $result = db_query_range($query, 0, 1);
  if ($maillog = $result
    ->fetchAssoc()) {
    // Unserialize values.
    $maillog['header_all'] = unserialize($maillog['header_all']);
  }
  return $maillog;
}