function DbLogTest::verifyReports
Same name in other branches
- 9 core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\DbLogTest::verifyReports()
- 8.9.x core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\DbLogTest::verifyReports()
- 11.x core/modules/dblog/tests/src/Functional/DbLogTest.php \Drupal\Tests\dblog\Functional\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 core/
modules/ dblog/ tests/ src/ Functional/ DbLogTest.php - Tests Database Logging module functionality through interfaces.
File
-
core/
modules/ dblog/ tests/ src/ Functional/ DbLogTest.php, line 352
Class
- DbLogTest
- Verifies log entries and user access based on permissions.
Namespace
Drupal\Tests\dblog\FunctionalCode
private function verifyReports($response = 200) {
// View the database log help page.
$this->drupalGet('admin/help/dblog');
$this->assertSession()
->statusCodeEquals($response);
if ($response == 200) {
$this->assertSession()
->pageTextContains('Database Logging');
}
// View the database log report page.
$this->drupalGet('admin/reports/dblog');
$this->assertSession()
->statusCodeEquals($response);
if ($response == 200) {
$this->assertSession()
->pageTextContains('Recent log messages');
}
$this->drupalGet('admin/reports/dblog/confirm');
$this->assertSession()
->statusCodeEquals($response);
if ($response == 200) {
$this->assertSession()
->pageTextContains('Are you sure you want to delete the recent logs?');
}
// View the database log page-not-found report page.
$this->drupalGet('admin/reports/page-not-found');
$this->assertSession()
->statusCodeEquals($response);
if ($response == 200) {
$this->assertSession()
->pageTextContains("Top 'page not found' errors");
}
// View the database log access-denied report page.
$this->drupalGet('admin/reports/access-denied');
$this->assertSession()
->statusCodeEquals($response);
if ($response == 200) {
$this->assertSession()
->pageTextContains("Top 'access denied' errors");
}
// View the database log event page.
$query = Database::getConnection()->select('watchdog');
$query->addExpression('MIN([wid])');
$wid = $query->execute()
->fetchField();
$this->drupalGet('admin/reports/dblog/event/' . $wid);
$this->assertSession()
->statusCodeEquals($response);
if ($response == 200) {
$this->assertSession()
->pageTextContains('Details');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.