1.20.x dblog.test private DBLogTestCase::verifyReports($response = 200)

Confirms that database log reports are displayed at the correct paths.

Parameters

int $response: (optional) HTTP response code. Defaults to 200.

File

modules/dblog/tests/dblog.test, line 163
Tests for dblog.module.

Class

DBLogTestCase
Tests logging messages to the database.

Code

private function verifyReports($response = 200) {
  $quote = ''';

  // View the database log report page.
  $this->backdropGet('admin/reports/dblog');

  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Recent log messages'), 'DBLog report was displayed');
  }

  // View the database log page-not-found report page.
  $this->backdropGet('admin/reports/page-not-found');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Top ' . $quote . 'page not found' . $quote . ' errors'), 'DBLog page-not-found report was displayed');
  }

  // View the database log access-denied report page.
  $this->backdropGet('admin/reports/access-denied');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Top ' . $quote . 'access denied' . $quote . ' errors'), 'DBLog access-denied report was displayed');
  }

  // View the database log event page.
  $this->backdropGet('admin/reports/event/1');
  $this->assertResponse($response);
  if ($response == 200) {
    $this->assertText(t('Details'), 'DBLog event node was displayed');
  }

  // Check the date format on the database log report page.
  $this->backdropGet('admin/reports/dblog');
}