function PermissionCheckerTest::testHasPermissionOnlyContrib
Same name in other branches
- 11.x core/tests/Drupal/Tests/Core/Session/PermissionCheckerTest.php \Drupal\Tests\Core\Session\PermissionCheckerTest::testHasPermissionOnlyContrib()
Tests the hasPermission method with only contrib scopes and identifiers.
File
-
core/
tests/ Drupal/ Tests/ Core/ Session/ PermissionCheckerTest.php, line 98
Class
- PermissionCheckerTest
- @coversDefaultClass \Drupal\Core\Session\PermissionChecker @group Session
Namespace
Drupal\Tests\Core\SessionCode
public function testHasPermissionOnlyContrib() : void {
$calculated_permissions = new CalculatedPermissions((new RefinableCalculatedPermissions())->addItem(new CalculatedPermissionsItem([
'baz',
], FALSE, 'other-scope', 'other-identifier')));
$this->processor
->processAccessPolicies($this->account)
->willReturn($calculated_permissions);
$this->assertFalse($this->checker
->hasPermission('foo', $this->account));
$this->assertFalse($this->checker
->hasPermission('bar', $this->account));
$this->assertFalse($this->checker
->hasPermission('baz', $this->account));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.