function UserRolesAccessPolicyTest::testGetPersistentCacheContexts

Same name in other branches
  1. 10 core/tests/Drupal/Tests/Core/Session/UserRolesAccessPolicyTest.php \Drupal\Tests\Core\Session\UserRolesAccessPolicyTest::testGetPersistentCacheContexts()

Tests the getPersistentCacheContexts method.

@covers ::getPersistentCacheContexts

File

core/tests/Drupal/Tests/Core/Session/UserRolesAccessPolicyTest.php, line 185

Class

UserRolesAccessPolicyTest
@coversDefaultClass \Drupal\Core\Session\UserRolesAccessPolicy @group Session

Namespace

Drupal\Tests\Core\Session

Code

public function testGetPersistentCacheContexts() : void {
    $this->assertSame([
        'user.roles',
    ], $this->accessPolicy
        ->getPersistentCacheContexts(AccessPolicyInterface::SCOPE_DRUPAL));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.