You are here

private function DBLogTestCase::verifyReports in Drupal 7

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

Parameters

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

1 call to DBLogTestCase::verifyReports()
DBLogTestCase::testDBLog in modules/dblog/dblog.test
Tests Database Logging module functionality through interfaces.

File

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

Class

DBLogTestCase
Tests logging messages to the database.

Code

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

  // View the database log help page.
  $this
    ->drupalGet('admin/help/dblog');
  $this
    ->assertResponse($response);
  if ($response == 200) {
    $this
      ->assertText(t('Database logging'), 'DBLog help was displayed');
  }

  // View the database log report page.
  $this
    ->drupalGet('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
    ->drupalGet('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
    ->drupalGet('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
    ->drupalGet('admin/reports/event/1');
  $this
    ->assertResponse($response);
  if ($response == 200) {
    $this
      ->assertText(t('Details'), 'DBLog event node was displayed');
  }
}