private function DBLogTestCase::verifyRowLimit

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

Verifies setting of the database log row limit.

Parameters

int $row_limit: The row limit.

1 call to DBLogTestCase::verifyRowLimit()
DBLogTestCase::testDBLog in drupal-7.x/modules/dblog/dblog.test
Tests Database Logging module functionality through interfaces.

File

drupal-7.x/modules/dblog/dblog.test, line 73
Tests for dblog.module.

Class

DBLogTestCase
Tests logging messages to the database.

Code

private function verifyRowLimit($row_limit) {
  // Change the database log 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, format_string('[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, format_string('[Variable table] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
}