You are here

protected function DbLogTest::assertLogMessage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/dblog/src/Tests/DbLogTest.php \Drupal\dblog\Tests\DbLogTest::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 DbLogTest::assertLogMessage()
DbLogTest::doNode in core/modules/dblog/src/Tests/DbLogTest.php
Generates and then verifies some node events.
DbLogTest::doUser in core/modules/dblog/src/Tests/DbLogTest.php
Generates and then verifies some user events.

File

core/modules/dblog/src/Tests/DbLogTest.php, line 698
Contains \Drupal\dblog\Tests\DbLogTest.

Class

DbLogTest
Generate events and verify dblog entries; verify user access to log reports based on permissions.

Namespace

Drupal\dblog\Tests

Code

protected function assertLogMessage($log_message, $message) {
  $message_text = Unicode::truncate(Html::decodeEntities(strip_tags($log_message)), 56, TRUE, TRUE);
  $this
    ->assertLink($message_text, 0, $message);
}