You are here

protected function KeyTestTrait::routeAccessTest in Key 8

Tests each route for the currently signed-in user.

3 calls to KeyTestTrait::routeAccessTest()
KeyAdminTest::testAdminUserRoutes in tests/src/Functional/KeyAdminTest.php
Tests key routes for an authorized user.
KeyNonAdminAccessTest::testNonAdminUserAccess in tests/src/Functional/KeyNonAdminAccessTest.php
Tests key routes for an unauthorized user.
KeyOverrideAdminTest::testOverrideUserRoutes in tests/src/Functional/KeyOverrideAdminTest.php
Tests key routes for overriding key configuration.

File

tests/src/Functional/KeyTestTrait.php, line 33

Class

KeyTestTrait
Used for key access tests.

Namespace

Drupal\Tests\key\Functional

Code

protected function routeAccessTest($routes, $response) {
  foreach ($routes as $route => $parameters) {
    $url = Url::fromRoute($route, $parameters);
    $this
      ->drupalGet($url);
    $this
      ->assertSession()
      ->statusCodeEquals($response);
  }
}