You are here

function CommentActionsTestCase::assertWatchdogMessage in Drupal 7

Verify that a watchdog message has been entered.

Parameters

$watchdog_message: The watchdog message.

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

$message: The assertion message.

2 calls to CommentActionsTestCase::assertWatchdogMessage()
CommentActionsTestCase::testCommentPublishUnpublishActions in modules/comment/comment.test
Test comment publish and unpublish actions.
CommentActionsTestCase::testCommentUnpublishByKeyword in modules/comment/comment.test
Tests the unpublish comment by keyword action.

File

modules/comment/comment.test, line 2029
Tests for comment.module.

Class

CommentActionsTestCase
Test actions provided by the comment module.

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,
  )));
}