function AccessPolicyProcessorTest::testNoCalculators

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

Tests that everything works if no access policies are present.

File

core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php, line 131

Class

AccessPolicyProcessorTest
Tests the AccessPolicyProcessor service.

Namespace

Drupal\Tests\Core\Session

Code

public function testNoCalculators() : void {
    $account = $this->prophesize(AccountInterface::class)
        ->reveal();
    $processor = $this->setUpAccessPolicyProcessor();
    $no_permissions = new RefinableCalculatedPermissions();
    $no_permissions->addCacheTags([
        'access_policies',
    ]);
    $calculated_permissions = $processor->processAccessPolicies($account, 'anything');
    $this->assertEquals(new CalculatedPermissions($no_permissions), $calculated_permissions);
}

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