function DbLogTest::testDbLog

Same name in other branches
  1. 9 core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\DbLogTest::testDbLog()
  2. 8.9.x core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\DbLogTest::testDbLog()
  3. 11.x core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\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/tests/src/Functional/DbLogTest.php, line 83

Class

DbLogTest
Verifies log entries and user access based on permissions.

Namespace

Drupal\Tests\dblog\Functional

Code

public function testDbLog() : void {
    // Log in the admin user.
    $this->drupalLogin($this->adminUser);
    $row_limit = 100;
    $this->verifyRowLimit($row_limit);
    $this->verifyEvents();
    $this->verifyReports();
    $this->verifyBreadcrumbs();
    $this->verifyLinkEscaping();
    // Verify the overview table sorting.
    $orders = [
        'Date',
        'Type',
        'User',
    ];
    $sorts = [
        'asc',
        'desc',
    ];
    foreach ($orders as $order) {
        foreach ($sorts as $sort) {
            $this->verifySort($sort, $order);
        }
    }
    // Log in the regular user.
    $this->drupalLogin($this->webUser);
    $this->verifyReports(403);
    $this->testLogEventNotFoundPage();
    $this->testLogEventPageWithMissingInfo();
    $this->test403LogEventPage();
    $this->testMessageParsing();
    $this->testOverviewLinks();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.