DBLogTestCase::verifyCron

7 dblog.test private DBLogTestCase::verifyCron($row_limit)
8 dblog.test private DBLogTestCase::verifyCron($row_limit)

Verify cron applies the dblog row limit.

Parameters

integer $count Log row limit.:

File

modules/dblog/dblog.test, line 73
Tests for dblog.module.

Code

private function verifyCron($row_limit) {
  // Generate additional log entries.
  $this->generateLogEntries($row_limit + 10);
  // Verify dblog row count exceeds row limit.
  $count = db_query('SELECT COUNT(wid) FROM {watchdog}')->fetchField();
  $this->assertTrue($count > $row_limit, t('Dblog row count of @count exceeds row limit of @limit', array('@count' => $count, '@limit' => $row_limit)));

  // Run cron job.
  $this->cronRun();
  // Verify dblog row count equals row limit plus one because cron adds a record after it runs.
  $count = db_query('SELECT COUNT(wid) FROM {watchdog}')->fetchField();
  $this->assertTrue($count == $row_limit + 1, t('Dblog row count of @count equals row limit of @limit plus one', array('@count' => $count, '@limit' => $row_limit)));
}
Login or register to post comments