function CommentActionsTest::assertWatchdogMessage

Verifies 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.

1 call to CommentActionsTest::assertWatchdogMessage()
CommentActionsTest::testCommentPublishUnpublishActions in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentActionsTest.php
Tests comment publish and unpublish actions.

File

drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentActionsTest.php, line 74
Definition of Drupal\comment\Tests\CommentActionsTest.

Class

CommentActionsTest
Tests actions provided by the Comment module.

Namespace

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