protected function DBLogTestCase::assertLogMessage in Drupal 7
Confirms that a log message appears on the database log overview screen.
This function should only be used for the admin/reports/dblog page, because it checks for the message link text truncated to 56 characters. Other log pages have no detail links so they contain the full message text.
Parameters
string $log_message: The database log message to check.
string $message: The message to pass to simpletest.
2 calls to DBLogTestCase::assertLogMessage()
- DBLogTestCase::doNode in modules/
dblog/ dblog.test - Generates and then verifies some node events.
- DBLogTestCase::doUser in modules/
dblog/ dblog.test - Generates and then verifies some user events.
File
- modules/
dblog/ dblog.test, line 661 - Tests for dblog.module.
Class
- DBLogTestCase
- Tests logging messages to the database.
Code
protected function assertLogMessage($log_message, $message) {
$message_text = truncate_utf8(filter_xss($log_message, array()), 56, TRUE, TRUE);
// After filter_xss(), HTML entities should be converted to their character
// equivalents because assertLink() uses this string in xpath() to query the
// Document Object Model (DOM).
$this
->assertLink(html_entity_decode($message_text), 0, $message);
}