5 require_once(__DIR__ .
"/mocks.php");
20 PHPUnit_Framework_Error_Deprecated::$enabled =
false;
22 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
24 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
25 ilUnitUtil::performInitialisation();
28 $this->root->putInTree(ROOT_FOLDER_ID);
45 $this->root->delete();
58 if (!array_key_exists(
"points",
$data)) {
59 throw new Exception(
"Expected to find 'points' in data array.");
62 $top->setPoints(
$data[
"points"]);
64 foreach (
$data as $node_name => $data2) {
65 if ($node_name ==
"points") {
68 if (isset($this->$node_name)) {
69 throw new Exception(
"Node $node_name already exists.");
74 $top->addLeaf($this->$node_name);
78 $top->addNode($this->$node_name);
89 ,
"node1" =>
array(
"points" => 100
93 ,
"node2" =>
array(
"points" => 100
100 $user_id = $user->getId();
101 $ass = $this->root->assignUser($user->getId());
102 $ass_id = $ass->getId();
104 $this->leaf11->markCompletedFor($user_id);
105 $this->leaf21->markCompletedFor($user_id);
115 ,
"node1" =>
array(
"points" => 100
119 ,
"node2" =>
array(
"points" => 100
126 $user_id = $user->getId();
127 $ass = $this->root->assignUser($user->getId());
128 $ass_id = $ass->getId();
130 $this->node1->getProgressForAssignment($ass_id)
131 ->markAccredited($this->
user->getId());
132 $this->leaf21->markCompletedFor($user_id);
142 ,
"node1" =>
array(
"points" => 100
146 ,
"node2" =>
array(
"points" => 100
153 $user_id = $user->getId();
154 $ass = $this->root->assignUser($user->getId());
155 $ass_id = $ass->getId();
157 $this->node1->getProgressForAssignment($ass_id)
158 ->markNotRelevant($this->
user->getId());
159 $this->root->getProgressForAssignment($ass_id)
160 ->setRequiredAmountOfPoints(100, $this->
user->getId());
161 $this->leaf21->markCompletedFor($user_id);
171 ,
"node1" =>
array(
"points" => 100
175 ,
"node2" =>
array(
"points" => 100
182 $user_id = $user->getId();
183 $ass = $this->root->assignUser($user->getId());
184 $ass_id = $ass->getId();
186 $this->node1->getProgressForAssignment($ass_id)
187 ->markNotRelevant($this->
user->getId());
188 $this->leaf11->markCompletedFor($user_id);
189 $this->leaf21->markCompletedFor($user_id);
199 ,
"node1" =>
array(
"points" => 100
203 ,
"node2" =>
array(
"points" => 100
210 $user_id = $user->getId();
211 $ass = $this->root->assignUser($user->getId());
212 $ass_id = $ass->getId();
216 $this->leaf11->markCompletedFor($user_id);
testInitialProgressOnOptionalNodes()
const STATUS_NOT_RELEVANT
TestCase for the assignment of users to a programme.
Create styles array
The data for the language used.
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.