private function DbLogTest::verifyReports

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

Parameters

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

1 call to DbLogTest::verifyReports()
DbLogTest::testDbLog in drupal/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
Tests Database Logging module functionality through interfaces.

File

drupal/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php, line 158
Contains \Drupal\dblog\Tests\DbLogTest.

Class

DbLogTest
Tests logging messages to the database.

Namespace

Drupal\dblog\Tests

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');
  }
}