public function RefinableCalculatedGroupPermissionsTest::testRemoveItem in Group 2.0.x
Same name and namespace in other branches
- 8 tests/src/Unit/RefinableCalculatedGroupPermissionsTest.php \Drupal\Tests\group\Unit\RefinableCalculatedGroupPermissionsTest::testRemoveItem()
Tests the removal of a calculated permissions item.
@covers ::removeItem @depends testAddItem
File
- tests/
src/ Unit/ RefinableCalculatedGroupPermissionsTest.php, line 48
Class
- RefinableCalculatedGroupPermissionsTest
- Tests the RefinableCalculatedGroupPermissions class.
Namespace
Drupal\Tests\group\UnitCode
public function testRemoveItem() {
$item = new CalculatedGroupPermissionsItem(CGPII::SCOPE_GROUP_TYPE, 'foo', [
'bar',
]);
$calculated_permissions = new RefinableCalculatedGroupPermissions();
$calculated_permissions
->addItem($item)
->removeItem(CGPII::SCOPE_GROUP_TYPE, 'foo');
$this
->assertFalse($calculated_permissions
->getItem(CGPII::SCOPE_GROUP_TYPE, 'foo'), 'Could not retrieve a removed item.');
}