You are here

protected function AccessTest::validateAccess in Apigee Edge 8

Checks whether the user has access to the given URL.

Parameters

\Drupal\Core\Url $url: The Url object to check.

int $expected_response_status_code: The expected HTTP response status code.

4 calls to AccessTest::validateAccess()
AccessTest::teamExpansionTest in modules/apigee_edge_teams/tests/src/Functional/AccessTest.php
Tests apigee_edge_teams_test module.
AccessTest::validateAccessToAdminRoutes in modules/apigee_edge_teams/tests/src/Functional/AccessTest.php
Checks whether the user has access to admin routes.
AccessTest::validateTeamAccess in modules/apigee_edge_teams/tests/src/Functional/AccessTest.php
Checks whether the user has access to team pages.
AccessTest::validateTeamAppAccess in modules/apigee_edge_teams/tests/src/Functional/AccessTest.php
Checks whether the user has access to team app pages.

File

modules/apigee_edge_teams/tests/src/Functional/AccessTest.php, line 609

Class

AccessTest
Teams module access test.

Namespace

Drupal\Tests\apigee_edge_teams\Functional

Code

protected function validateAccess(Url $url, int $expected_response_status_code) {
  $this
    ->drupalGet($url
    ->toString());
  $code = $this
    ->getSession()
    ->getStatusCode();
  $current_user_roles = implode(', ', $this->account
    ->getRoles());
  $this
    ->assertEquals($expected_response_status_code, $code, "Visited path: {$url->getInternalPath()}. User roles: {$current_user_roles}");
}