DBLogTestCase::verifyRowLimit

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

Verify setting of the dblog row limit.

Parameters

integer $count Log row limit.:

File

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

Code

private function verifyRowLimit($row_limit) {
  // Change the dblog row limit.
  $edit = array();
  $edit['dblog_row_limit'] = $row_limit;
  $this->drupalPost('admin/config/development/logging', $edit, t('Save configuration'));
  $this->assertResponse(200);

  // Check row limit variable.
  $current_limit = variable_get('dblog_row_limit', 1000);
  $this->assertTrue($current_limit == $row_limit, t('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
  // Verify dblog row limit equals specified row limit.
  $current_limit = unserialize(db_query("SELECT value FROM {variable} WHERE name = :dblog_limit", array(':dblog_limit' => 'dblog_row_limit'))->fetchField());
  $this->assertTrue($current_limit == $row_limit, t('[Variable table] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
}
Login or register to post comments