function DbLogTest::assertLogMessage
Same name in other branches
- 9 core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\DbLogTest::assertLogMessage()
- 8.9.x core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\DbLogTest::assertLogMessage()
- 11.x core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\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.
@internal
Parameters
string $log_message: The database log message to check.
string $message: A message to display if the assertion fails.
2 calls to DbLogTest::assertLogMessage()
- DbLogTest::doNode in core/
modules/ dblog/ tests/ src/ Functional/ DbLogTest.php - Generates and then verifies some node events.
- DbLogTest::doUser in core/
modules/ dblog/ tests/ src/ Functional/ DbLogTest.php - Generates and then verifies some user events.
File
-
core/
modules/ dblog/ tests/ src/ Functional/ DbLogTest.php, line 826
Class
- DbLogTest
- Verifies log entries and user access based on permissions.
Namespace
Drupal\Tests\dblog\FunctionalCode
protected function assertLogMessage(string $log_message, string $message) : void {
$message_text = Unicode::truncate($log_message, 56, TRUE, TRUE);
$this->assertSession()
->linkExists($message_text, 0, $message);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.