39 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
40 ilUnitUtil::performInitialisation();
51 global $rbacreview,$rbacadmin;
54 $non_empty = $rbacreview->filterEmptyRoleFolders(array(8));
55 $this->assertEquals($non_empty,array(8));
58 $empty = $rbacreview->filterEmptyRoleFolders(array(1));
59 $this->assertEquals($empty,array());
62 $rbacadmin->setProtected(1,4,
'y');
63 $prot = $rbacreview->isProtected(8,4);
64 $this->assertEquals($prot,
true);
65 $rbacadmin->setProtected(1,4,
'n');
66 $prot = $rbacreview->isProtected(8,4);
67 $this->assertEquals($prot,
false);
69 $rbacreview->getRoleListByObject(8);
70 $rbacreview->getAssignableRoles();
73 $ass = $rbacreview->isAssignable(4,8);
74 $this->assertEquals($ass,
true);
76 $roles = $rbacreview->getRolesOfRoleFolder(8);
77 $rbacreview->__getAllRoleFolderIds();
79 $rbacreview->getLinkedRolesOfRoleFolder(8);
81 $obj = $rbacreview->getObjectOfRole(4);
82 $this->assertEquals(9,$obj);
84 $rbacreview->getRolesForIDs(array(4),
false);
93 global $rbacreview,$rbacadmin;
97 $rbacreview->assignedUsers(4);
98 $rbacreview->assignedRoles(6);
109 global $rbacreview,$rbacadmin;
111 $sess_ops = $rbacreview->getOperationsOnTypeString(
'sess');
113 $rbacadmin->assignOperationToObject($rbacreview->getTypeId(
'sess'),
'7');
117 $rbacadmin->deassignOperationFromObject($rbacreview->getTypeId(
'sess'),
'7');
118 $new_sess_ops = $rbacreview->getOperationsOnTypeString(
'sess');
119 $this->assertEquals($sess_ops,$new_sess_ops);
128 global $rbacreview,$rbacadmin;
130 $sess_ops = $rbacreview->getOperationsOnTypeString(
'cat');
132 $rbacadmin->revokePermission(1,4);
133 $rbacadmin->grantPermission(4,array(2,3),1);
145 include_once
'./Services/AccessControl/classes/class.ilConditionHandler.php';
151 $handler->setTargetRefId(99999);
152 $handler->setTargetObjId(99998);
153 $handler->setTargetType(
'xxx');
154 $handler->setTriggerRefId(99997);
155 $handler->setTriggerObjId(99996);
156 $handler->setTriggerType(
'yyy');
157 $handler->setReferenceHandlingType(0);
158 $handler->enableAutomaticValidation(
false);
159 $suc = $handler->storeCondition();
160 $this->assertEquals($suc,
true);
162 $suc = $handler->checkExists();
163 $this->assertEquals($suc,
false);
165 $suc = $handler->delete(99999);
166 $this->assertEquals($suc,
true);
169 $handler->deleteByObjId(-1);
170 $handler->deleteCondition(-1);
181 include_once
'./Services/AccessControl/classes/class.ilAccessHandler.php';
184 $handler->setResults(array(1,2,3));
185 $handler->storeCache();
186 $handler->readCache();
187 $res = $handler->getResults();
189 $this->assertEquals(array(1,2,3),
$res);