You are here

private function SecurityAdvisoryTest::assertAdvisoriesNotDisplayed in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/SecurityAdvisories/SecurityAdvisoryTest.php \Drupal\Tests\system\Functional\SecurityAdvisories\SecurityAdvisoryTest::assertAdvisoriesNotDisplayed()

Asserts that security advisory links are not shown on admin pages.

@internal

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 270

Class

SecurityAdvisoryTest
Tests of security advisories functionality.

Namespace

Drupal\Tests\system\Functional\SecurityAdvisories

Code

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}'.");
    }
  }
}