You are here

private function MongoDBLogTestCase::verifyReports in MongoDB 7

Same name and namespace in other branches
  1. 8 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::verifyReports()
  2. 6 mongodb_watchdog/mongodb_watchdog.test \MongoDBLogTestCase::verifyReports()

Verify the logged in user has the desired access to the dblog nodes.

Parameters

int $response: HTTP response code.

1 call to MongoDBLogTestCase::verifyReports()
MongoDBLogTestCase::ztestDbLog in mongodb_watchdog/mongodb_watchdog.test
Test dblog functionality through the admin and user interfaces.

File

mongodb_watchdog/mongodb_watchdog.test, line 286
Contains \MongoDBLogTestCase.

Class

MongoDBLogTestCase

Code

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

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

  // View dblog report node.
  $this
    ->drupalGet('admin/reports/dblog');
  $this
    ->assertResponse($response);
  if ($response == 200) {
    $this
      ->assertText(t('Recent log entries'), t('DBLog report was displayed'));
  }

  // View dblog page-not-found report node.
  $this
    ->drupalGet('admin/reports/page-not-found');
  $this
    ->assertResponse($response);
  if ($response == 200) {

    // phpcs:ignore
    $this
      ->assertText(t("Top {$quote}page not found{$quote} errors"), t('DBLog page-not-found report was displayed'));
  }

  // View dblog access-denied report node.
  $this
    ->drupalGet('admin/reports/access-denied');
  $this
    ->assertResponse($response);
  if ($response == 200) {

    // phpcs:ignore
    $this
      ->assertText(t("Top {$quote}access denied{$quote} errors"), t('DBLog access-denied report was displayed'));
  }

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