protected function DBLogTestCase::assertLogMessage

7.x dblog.test protected DBLogTestCase::assertLogMessage($log_message, $message)

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 drupal-7.x/modules/dblog/dblog.test
Generates and then verifies some node events.
DBLogTestCase::doUser in drupal-7.x/modules/dblog/dblog.test
Generates and then verifies some user events.

File

drupal-7.x/modules/dblog/dblog.test, line 629
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);
}