You are here

function DbLogTest::testDbLog in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/dblog/src/Tests/DbLogTest.php \Drupal\dblog\Tests\DbLogTest::testDbLog()

Tests Database Logging module functionality through interfaces.

First logs in users, then creates database log events, and finally tests Database Logging module functionality through both the admin and user interfaces.

File

core/modules/dblog/src/Tests/DbLogTest.php, line 66
Contains \Drupal\dblog\Tests\DbLogTest.

Class

DbLogTest
Generate events and verify dblog entries; verify user access to log reports based on permissions.

Namespace

Drupal\dblog\Tests

Code

function testDbLog() {

  // Login the admin user.
  $this
    ->drupalLogin($this->adminUser);
  $row_limit = 100;
  $this
    ->verifyRowLimit($row_limit);
  $this
    ->verifyCron($row_limit);
  $this
    ->verifyEvents();
  $this
    ->verifyReports();
  $this
    ->verifyBreadcrumbs();
  $this
    ->verifyLinkEscaping();

  // Verify the overview table sorting.
  $orders = array(
    'Date',
    'Type',
    'User',
  );
  $sorts = array(
    'asc',
    'desc',
  );
  foreach ($orders as $order) {
    foreach ($sorts as $sort) {
      $this
        ->verifySort($sort, $order);
    }
  }

  // Login the regular user.
  $this
    ->drupalLogin($this->webUser);
  $this
    ->verifyReports(403);
}