You are here

private function MongoDBLogTestCase::verifyReports in MongoDB 8

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

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

Parameters

integer $response HTTP response code.:

1 call to MongoDBLogTestCase::verifyReports()
MongoDBLogTestCase::ZtestDBLog in mongodb_watchdog/mongodb_watchdog.test
Login users, create dblog events, and test dblog functionality through the admin and user interfaces.

File

mongodb_watchdog/mongodb_watchdog.test, line 270
Test class for MongoDB_watchdog.

Class

MongoDBLogTestCase
Test the behaviour of watchdog() mongodb_watchdog, not dblog

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