eZ\Publish\Core\Repository\Tests\Service\Integration\RoleBase::testRemovePolicy PHP Method

testRemovePolicy() public method

Test removing policy from the role.
public testRemovePolicy ( )
    public function testRemovePolicy()
    {
        $roleService = $this->repository->getRoleService();
        $role = $roleService->loadRole(1);
        $policies = $role->getPolicies();
        $policyCount = count($policies);
        self::assertGreaterThan(0, $policyCount);
        $updatedRole = $roleService->removePolicy($role, $policies[0]);
        self::assertCount($policyCount - 1, $updatedRole->getPolicies());
    }