1.20.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.

File

modules/dblog/tests/dblog.test, line 672
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);
}