private function SecurityAdvisoryTest::assertAdvisoriesNotDisplayed in Drupal 9
Asserts that security advisory links are not shown on admin pages.
Parameters
array $links: The advisory links.
array $routes: The routes to test.
1 call to SecurityAdvisoryTest::assertAdvisoriesNotDisplayed()
- SecurityAdvisoryTest::testPsa in core/
modules/ system/ tests/ src/ Functional/ SecurityAdvisories/ SecurityAdvisoryTest.php - Tests that a security advisory is displayed.
File
- core/
modules/ system/ tests/ src/ Functional/ SecurityAdvisories/ SecurityAdvisoryTest.php, line 264
Class
- SecurityAdvisoryTest
- Tests of security advisories functionality.
Namespace
Drupal\Tests\system\Functional\SecurityAdvisoriesCode
private function assertAdvisoriesNotDisplayed(array $links, array $routes = [
'system.status',
'system.admin',
]) : void {
foreach ($routes as $route) {
$this
->drupalGet(Url::fromRoute($route));
$this
->assertSession()
->statusCodeEquals(200);
foreach ($links as $link) {
$this
->assertSession()
->linkNotExists($link, "'{$link}' not displayed on route '{$route}'.");
}
}
}