function PermissionCheckerTest::testHasPermissionEmpty

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

Tests the hasPermission method when no policy added something.

File

core/tests/Drupal/Tests/Core/Session/PermissionCheckerTest.php, line 69

Class

PermissionCheckerTest
@coversDefaultClass \Drupal\Core\Session\PermissionChecker @group Session

Namespace

Drupal\Tests\Core\Session

Code

public function testHasPermissionEmpty() : void {
    $calculated_permissions = new CalculatedPermissions(new RefinableCalculatedPermissions());
    $this->processor
        ->processAccessPolicies($this->account)
        ->willReturn($calculated_permissions);
    $this->assertFalse($this->checker
        ->hasPermission('foo', $this->account));
    $this->assertFalse($this->checker
        ->hasPermission('bar', $this->account));
}

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