function SuperUserAccessPolicyTest::testGetPersistentCacheContexts

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

Tests the getPersistentCacheContexts method.

@covers ::getPersistentCacheContexts

File

core/tests/Drupal/Tests/Core/Session/SuperUserAccessPolicyTest.php, line 136

Class

SuperUserAccessPolicyTest
@coversDefaultClass \Drupal\Core\Session\SuperUserAccessPolicy @group Session

Namespace

Drupal\Tests\Core\Session

Code

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

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