function RefinableCalculatedPermissionsTest::testRemoveItem

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

Tests the removal of a calculated permissions item.

@depends testAddItem

File

core/tests/Drupal/Tests/Core/Session/RefinableCalculatedPermissionsTest.php, line 66

Class

RefinableCalculatedPermissionsTest
Tests the RefinableCalculatedPermissions class.

Namespace

Drupal\Tests\Core\Session

Code

public function testRemoveItem() : void {
    $scope = 'some_scope';
    $item = new CalculatedPermissionsItem([
        'bar',
    ], FALSE, $scope, 'foo');
    $calculated_permissions = new RefinableCalculatedPermissions();
    $calculated_permissions->addItem($item);
    $calculated_permissions->removeItem($scope, 'foo');
    $this->assertFalse($calculated_permissions->getItem($scope, 'foo'), 'Could not retrieve a removed item.');
}

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