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

Verifies that a watchdog message has been entered.

@since 1.19.0 Method added.

Parameters

$watchdog_message: The watchdog message.

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

$message: The assertion message.

File

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

Class

BackdropWebTestCase
Test case for typical Backdrop tests.

Code

function assertWatchdogMessage($watchdog_message, $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)));
}