public function DbLogTest::testOverviewLinks in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/dblog/src/Tests/DbLogTest.php \Drupal\dblog\Tests\DbLogTest::testOverviewLinks()
Make sure HTML tags are filtered out in the log overview links.
File
- core/
modules/ dblog/ src/ Tests/ DbLogTest.php, line 735 - 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\TestsCode
public function testOverviewLinks() {
$this
->drupalLogin($this->adminUser);
$this
->generateLogEntries(1, [
'message' => "<script>alert('foo');</script><strong>Lorem</strong> ipsum dolor sit amet, consectetur adipiscing & elit.",
]);
$this
->drupalGet('admin/reports/dblog');
$this
->assertResponse(200);
// Make sure HTML tags are filtered out.
$this
->assertRaw('title="alert('foo');Lorem ipsum dolor sit amet, consectetur adipiscing & elit. Entry #0"><script>alert('foo');</script>Lorem ipsum dolor sit…</a>');
$this
->assertNoRaw("<script>alert('foo');</script>");
}