You are here

function advancedqueue_test_count_watchdog in Advanced Queue 7

Verify log entries exist.

Called in the same way of the expected original watchdog() execution. Based on ModuleTestCase::assertLogMessage().

Parameters

string $type: The category to which this message belongs.

string $message: The message to store in the log. Keep $message translatable by not concatenating dynamic values into it! Variables in the message should be added by using placeholder strings alongside the variables argument to declare the value of the placeholders. See t() for documentation on how $message and $variables interact.

array $variables: Array of variables to replace in the message on display or NULL if message is already translated or not possible to translate.

int $severity: The severity of the message, as per RFC 3164.

string $link: A link to associate with the message.

1 call to advancedqueue_test_count_watchdog()
AdvancedQueueCronTestCase::testCronWorker in tests/advancedqueue.test
Test cron calls workers.

File

tests/advancedqueue_test.inc, line 62
Functions common for Simpletest DrupalWebTestCase.

Code

function advancedqueue_test_count_watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = '') {
  $count = db_select('watchdog', 'w')
    ->condition('type', $type)
    ->condition('message', $message)
    ->condition('variables', serialize($variables))
    ->condition('severity', $severity)
    ->condition('link', $link)
    ->countQuery()
    ->execute()
    ->fetchField();
  return $count;
}