function CalculatedPermissionsItemTest::testHasPermissionWithAdminFlag
Same name in other branches
- 11.x core/tests/Drupal/Tests/Core/Session/CalculatedPermissionsItemTest.php \Drupal\Tests\Core\Session\CalculatedPermissionsItemTest::testHasPermissionWithAdminFlag()
Tests the permission check when the admin flag is set.
@covers ::hasPermission @depends testConstructor
File
-
core/
tests/ Drupal/ Tests/ Core/ Session/ CalculatedPermissionsItemTest.php, line 59
Class
- CalculatedPermissionsItemTest
- Tests the CalculatedPermissionsItem value object.
Namespace
Drupal\Tests\Core\SessionCode
public function testHasPermissionWithAdminFlag() : void {
$item = new CalculatedPermissionsItem([
'bar',
], TRUE, 'some_scope', 'foo');
$this->assertTrue($item->hasPermission('baz'), 'Missing permission was found.');
$this->assertTrue($item->hasPermission('bar'), 'Existing permission was found.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.