function DBLogTestCase::assertLogMessage

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 709

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.