1 backdrop_web_test_case.php protected BackdropWebTestCase::assertWatchdogMessage($watchdog_message, array $variables, $message)

Verifies that a watchdog message has been entered.

@since 1.19.0 Method added.

Parameters

string $watchdog_message: The watchdog message.

array $variables: The array of variables passed to watchdog().

string $message: The assertion message.

File

core/modules/simpletest/backdrop_web_test_case.php, line 4009

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

protected function assertWatchdogMessage($watchdog_message, array $variables, $message) {
  $status = (bool) db_query_range("SELECT 1 FROM {watchdog} WHERE message = :message AND variables = :variables", 0, 1, array(
    ':message' => $watchdog_message,
    ':variables' => serialize($variables),
  ))->fetchField();
  return $this->assert($status, format_string('@message', array('@message' => $message)));
}