ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjStudyProgrammeTest.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2009 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
24use PHPUnit\Framework\TestCase;
25
26require_once(__DIR__ . "/mocks.php");
27
37class ilObjStudyProgrammeTest extends TestCase
38{
39 protected $backupGlobals = false;
40
41 protected function setUp() : void
42 {
43 require_once("./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
44 PHPUnit\Framework\Error\Deprecated::$enabled = false;
45
46 global $DIC;
47 if (!$DIC) {
48 try {
49 include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
50 ilUnitUtil::performInitialisation();
51 } catch (Exception $e) {
52 }
53 }
54
55 $this->root_object = ilObjStudyProgramme::createInstance();
56 $this->root_object_obj_id = $this->root_object->getId();
57 $this->root_object_ref_id = $this->root_object->getRefId();
58 $this->root_object->putInTree(ROOT_FOLDER_ID);
59
60 global $DIC;
61 $tree = $DIC['tree'];
62 $this->tree = $tree;
63
64 $objDefinition = $DIC['objDefinition'];
65 $this->obj_definition = $objDefinition;
66 }
67
68 protected function tearDown() : void
69 {
70 if ($this->root_object) {
71 $this->root_object->delete();
72 }
73 }
74
78 public function testCreation()
79 {
80 $this->assertNotEmpty($this->root_object_obj_id);
81 $this->assertGreaterThan(0, $this->root_object_obj_id);
82
83 $this->assertNotEmpty($this->root_object_ref_id);
84 $this->assertGreaterThan(0, $this->root_object_ref_id);
85
86 $this->assertTrue($this->tree->isInTree($this->root_object_ref_id));
87 }
88
89 public function testDefaults()
90 {
91 $this->assertEquals($this->root_object->getStatus(), ilStudyProgrammeSettings::STATUS_DRAFT);
92 }
93
99 public function testLoadByObjId()
100 {
101 $loaded = new ilObjStudyProgramme($this->root_object_obj_id, false);
102 $orig = $this->root_object;
103 $load_ref_id = ilObjStudyProgramme::getInstanceByRefId($this->root_object_ref_id);
104
105 $this->assertNotNull($loaded);
106 $this->assertGreaterThan(0, $loaded->getId());
107 $this->assertEquals($orig->getId(), $loaded->getId());
108 $this->assertEquals(
109 $orig->getLastChange()->format('YmdHis'),
110 $loaded->getLastChange()->format('YmdHis')
111 );
112 $this->assertEquals($orig->getPoints(), $loaded->getPoints());
113 $this->assertEquals($orig->getLPMode(), $loaded->getLPMode());
114 $this->assertEquals($orig->getStatus(), $loaded->getStatus());
115 }
116
122 public function testLoadByRefId()
123 {
124 $loaded = new ilObjStudyProgramme($this->root_object_ref_id);
125 $orig = $this->root_object;
126
127 $this->assertNotNull($loaded);
128 $this->assertGreaterThan(0, $loaded->getId());
129 $this->assertEquals($orig->getId(), $loaded->getId());
130 $this->assertEquals(
131 $orig->getLastChange()->format('YmdHis'),
132 $loaded->getLastChange()->format('YmdHis')
133 );
134 $this->assertEquals($orig->getPoints(), $loaded->getPoints());
135 $this->assertEquals($orig->getLPMode(), $loaded->getLPMode());
136 $this->assertEquals($orig->getStatus(), $loaded->getStatus());
137 }
138
144 public function testGetInstanceByRefId()
145 {
146 require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgrammeCache.php");
147
149 $this->assertTrue(ilObjStudyProgrammeCache::singleton()->test_isEmpty());
150
151 $loaded = ilObjStudyProgramme::getInstanceByRefId($this->root_object_ref_id);
152 $orig = $this->root_object;
153
154 $this->assertNotNull($loaded);
155 $this->assertGreaterThan(0, $loaded->getId());
156 $this->assertEquals($orig->getId(), $loaded->getId());
157 $this->assertEquals(
158 $orig->getLastChange()->format('YmdHis'),
159 $loaded->getLastChange()->format('YmdHis')
160 );
161 $this->assertEquals($orig->getPoints(), $loaded->getPoints());
162 $this->assertEquals($orig->getLPMode(), $loaded->getLPMode());
163 $this->assertEquals($orig->getStatus(), $loaded->getStatus());
164 }
165
171 public function testSettings()
172 {
173 $date = new DateTime();
174 $obj = ilObjStudyProgramme::getInstanceByRefId($this->root_object_ref_id);
175
176 $assessment_settings = $obj->getAssessmentSettings();
177 $auto_mail_settings = $obj->getAutoMailSettings();
178 $validity_of_qualification_settings = $obj->getValidityOfQualificationSettings();
179 $deadline_settings = $obj->getDeadlineSettings();
180 $type_settings = $obj->getTypeSettings();
181
182 $this->assertInstanceOf(ilStudyProgrammeAssessmentSettings::class, $assessment_settings);
183 $this->assertInstanceOf(ilStudyProgrammeAutoMailSettings::class, $auto_mail_settings);
184 $this->assertInstanceOf(
185 ilStudyProgrammeValidityOfAchievedQualificationSettings::class,
186 $validity_of_qualification_settings
187 );
188 $this->assertInstanceOf(ilStudyProgrammeDeadlineSettings::class, $deadline_settings);
189 $this->assertInstanceOf(ilStudyProgrammeTypeSettings::class, $type_settings);
190
191 $assessment_settings = $assessment_settings
193 ->withPoints(10)
194 ;
195
196 $auto_mail_settings = $auto_mail_settings
197 ->withProcessingEndsNotSuccessfulDays(10)
198 ->withReminderNotRestartedByUserDays(10)
199 ->withSendReAssignedMail(true)
200 ;
201
202 $validity_of_qualification_settings = $validity_of_qualification_settings
203 ->withRestartPeriod(10)
204 ->withQualificationPeriod(10)
205 ->withQualificationDate($date)
206 ;
207
208 $deadline_settings = $deadline_settings
209 ->withDeadlinePeriod(10)
210 ->withDeadlineDate($date)
211 ;
212
213 $type_settings = $type_settings->withTypeId(10);
214
215 $obj->setAssessmentSettings($assessment_settings);
216 $obj->setAutoMailSettings($auto_mail_settings);
217 $obj->setValidityOfQualificationSettings($validity_of_qualification_settings);
218 $obj->setDeadlineSettings($deadline_settings);
219 $obj->setTypeSettings($type_settings);
220 $obj->update();
221
222 $obj = ilObjStudyProgramme::getInstanceByRefId($this->root_object_ref_id);
223
224 $assessment_settings = $obj->getAssessmentSettings();
225 $auto_mail_settings = $obj->getAutoMailSettings();
226 $validity_of_qualification_settings = $obj->getValidityOfQualificationSettings();
227 $deadline_settings = $obj->getDeadlineSettings();
228 $type_settings = $obj->getTypeSettings();
229
230 $this->assertEquals(
232 $assessment_settings->getStatus()
233 );
234 $this->assertEquals(10, $assessment_settings->getPoints());
235 $this->assertEquals(10, $auto_mail_settings->getProcessingEndsNotSuccessfulDays());
236 $this->assertEquals(10, $auto_mail_settings->getReminderNotRestartedByUserDays());
237 $this->assertTrue($auto_mail_settings->getSendReAssignedMail());
238 $this->assertEquals(10, $validity_of_qualification_settings->getRestartPeriod());
239 $this->assertEquals(10, $validity_of_qualification_settings->getQualificationPeriod());
240 $this->assertSame($date, $validity_of_qualification_settings->getQualificationDate());
241 $this->assertEquals(10, $deadline_settings->getDeadlinePeriod());
242 $this->assertSame($date, $deadline_settings->getDeadlineDate());
243 $this->assertEquals(10, $type_settings->getTypeId());
244 }
245
251 public function testDelete()
252 {
253 $deleted_object = ilObjStudyProgramme::getInstanceByRefId($this->root_object_ref_id);
254
255 $this->assertTrue($deleted_object->delete());
256 }
257
261 protected function createSmallTree()
262 {
266
267 $this->root_object->addNode($first_node);
268 $this->root_object->addNode($second_node);
269 $this->root_object->addNode($third_node);
270
271 $third_first_node = ilObjStudyProgramme::createInstance();
272 $third_node->addNode($third_first_node);
273 }
274
280 public function testTreeCreation()
281 {
282 $this->createSmallTree();
283 $this->assertEquals(3, $this->root_object->getAmountOfChildren());
284 }
285
292 public function testTreeGetChildren()
293 {
294 $this->createSmallTree();
295
296 $children = $this->root_object->getChildren();
297 $this->assertEquals(3, count($children), "getChildren()");
298
299 $children = ilObjStudyProgramme::getAllChildren($this->root_object_ref_id);
300 $this->assertEquals(4, count($children), "ilObjStudyProgramme::getAllChildren(" . $this->root_object_ref_id . ")");
301
302 $this->assertTrue($this->root_object->hasChildren(), "hasChildren()");
303 $this->assertEquals(3, $this->root_object->getAmountOfChildren(), "getAmountOfChildren()");
304
305 $this->assertFalse($children[0]->hasChildren(), "hasChildren()");
306 $this->assertEquals(0, $children[0]->getAmountOfChildren(), "getAmountOfChildren()");
307 $this->assertEquals(0, count($children[0]->getChildren()));
308 }
309
311 {
312 $this->createSmallTree();
313 $this->assertEquals(
314 4,
315 $this->root_object->getAllPrgChildren()
316 );
317 }
318
324 public function testTreeGetParent()
325 {
326 $this->createSmallTree();
327 $children = $this->root_object->getChildren();
328
329 $child = $children[0];
330 $this->assertNotNull($child->getParent());
331 $this->assertNull($this->root_object->getParent());
332 }
333
337 public function testTreeGetParents()
338 {
339 $this->createSmallTree();
341 $children = $this->root_object->getChildren();
342 $children[0]->addNode($node3);
343
344 $parents = $node3->getParents();
345 $parent_ids = array_map(function ($node) {
346 return $node->getId();
347 }, $parents);
348 $parent_ids_expected = array( $this->root_object->getId()
349 , $children[0]->getId()
350 );
351
352 $this->assertEquals($parent_ids_expected, $parent_ids);
353 }
354
360 public function testTreeDepth()
361 {
362 $this->createSmallTree();
363 $children = $this->root_object->getChildren();
364
365 $child = $children[0];
366
367 $this->assertEquals(1, $child->getDepth());
368 }
369
375 public function testTreeGetRoot()
376 {
377 $this->createSmallTree();
378 $children = $this->root_object->getChildren();
379 $child = $children[0];
380
381 $this->assertEquals($this->root_object->getId(), $child->getRoot()->getId());
382 }
383
389 public function testApplyToSubTreeNodes()
390 {
391 $this->createSmallTree();
392 $children = $this->root_object->getChildren();
393
394 $val = 0;
395 $this->root_object->applyToSubTreeNodes(function ($node) use (&$val) {
396 $val += $node->getPoints();
397 });
398
399 // We didn't make modification on the points of the nodes.
400 $this->assertEquals($val, 5 * ilStudyProgrammeSettings::DEFAULT_POINTS);
401
402
403 $this->root_object->setPoints(1);
404 $children[0]->setPoints(2);
405 $children[1]->setPoints(4);
406 $children[2]->setPoints(1);
407
408 $third_level = $children[2]->getChildren();
409 $third_level[0]->setPoints(2);
410
411 $val = 0;
412 $this->root_object->applyToSubTreeNodes(function ($node) use (&$val) {
413 $val += $node->getPoints();
414 });
415
416 $this->assertEquals($val, 10);
417 }
418
424 public function testAddNode()
425 {
426 $this->createSmallTree();
427
428 $children = $this->root_object->getChildren();
429 $child = $children[0];
430 $grandchild = new ilObjStudyProgramme();
431 $grandchild->create();
432 $child->addNode($grandchild);
433
434 $this->assertEquals($child->getId(), $grandchild->getParent()->getId());
435 $this->assertEquals(
436 $this->root_object->getId(),
437 $grandchild->getRoot()->getId(),
438 "Root of grandchild is root of tree."
439 );
440 $this->assertEquals(1, $child->getAmountOfChildren());
441 $this->assertEquals(2, $grandchild->getDepth());
442 $this->assertEquals($child->getLPMode(), ilStudyProgrammeSettings::MODE_POINTS);
443 }
444
450 public function testRemoveNode()
451 {
452 $this->createSmallTree();
453
454 $children = $this->root_object->getChildren();
455 $child = $children[0];
456 $this->root_object->removeNode($child);
457
458 // Is not in tree anymore...
459 $raised = false;
460 try {
461 $child->getParent();
463 $raised = true;
464 }
465 $this->assertTrue($raised, "Child does not raise on getParent after it is removed.");
466
467 $this->assertEquals(2, $this->root_object->getAmountOfChildren());
468
469 // Can't be removed a second time...
470 $raised = false;
471 try {
472 $this->root_object->removeNode($child);
474 $raised = true;
475 }
476 $this->assertTrue($raised, "Child can be removed two times.");
477 }
478
484 public function testAddLeaf()
485 {
486 $this->createSmallTree();
487 $mock_leaf = new ilStudyProgrammeLeafMock();
488
489 $children = $this->root_object->getChildren();
490 $first_child = $children[0];
491
492 $first_child->addLeaf($mock_leaf);
493
494 // We use our mock factory, since the original factory won't know how
495 // to create our mock leaf.
496 $first_child->object_factory = new ilObjectFactoryWrapperMock();
497
498 $this->assertEquals(3, $this->root_object->getAmountOfChildren(), "getAmountOfChildren()");
499 // Check if StudyProgrammes are not counted as LP-Children
500 $this->assertEquals(0, $this->root_object->getAmountOfLPChildren(), "getAmountOfLPChildren() on root");
501 $this->assertEquals(false, $this->root_object->hasLPChildren(), "hasLPChildren() on root");
502
503 $this->assertEquals(1, $first_child->getAmountOfLPChildren(), "getAmountOfLPChildren() on first child");
504 $this->assertEquals(true, $first_child->hasLPChildren(), "hasLPChildren() on first child");
505 $this->assertEquals($first_child->getLPMode(), ilStudyProgrammeSettings::MODE_LP_COMPLETED);
506
507 $lp_children = $first_child->getLPChildren();
508 $this->assertEquals(1, count($lp_children));
509 $this->assertEquals($mock_leaf->getId(), $lp_children[0]->getId());
510 }
511
517 public function testRemoveLeaf()
518 {
519 $mock_leaf = new ilStudyProgrammeLeafMock();
520 $this->root_object->addLeaf($mock_leaf);
521
522 $this->root_object->removeLeaf($mock_leaf);
523 $this->assertEquals(0, $this->root_object->getAmountOfChildren(), "getAmountOfChildren()");
524 $this->assertEquals(0, $this->root_object->getAmountOfLPChildren(), "getAmountOfLPChildren()");
525
526 $lp_children = $this->root_object->getLPChildren();
527 $this->assertEquals(0, count($lp_children));
528 }
529
534 public function testAddWrongChildType()
535 {
536 $this->createSmallTree();
537 $children = $this->root_object->getChildren();
538 $child_n = $children[0];
539 $child_l = $children[1];
540
541 $mock_leaf1 = new ilStudyProgrammeLeafMock();
542 $mock_leaf2 = new ilStudyProgrammeLeafMock();
543 $node1 = new ilObjStudyProgramme();
544 $node2 = new ilObjStudyProgramme();
545 $node1->create();
546 $node2->create();
547
548 $child_n->addNode($node1);
549 $child_l->addLeaf($mock_leaf1);
550
551 $raised = false;
552 try {
553 $child_n->addLeaf($mock_leaf2);
555 $raised = true;
556 }
557 $this->assertTrue($raised, "Could add leaf to program containing node.");
558
559 $raised = false;
560 try {
561 $child_n->addLeaf($mock_leaf2);
563 $raised = true;
564 }
565 $this->assertTrue($raised, "Could add node to program containing leaf.");
566 }
567
571 public function testMoveTo()
572 {
573 $this->createSmallTree();
574 $children = $this->root_object->getChildren();
575 $child_l = $children[0];
576 $child_r = $children[1];
577 $child_m = $children[2];
578
579 $child_r->moveTo($child_l);
580
581 $this->assertEquals(2, $child_r->getDepth());
582 $this->assertEquals($child_l->getId(), $child_r->getParent()->getId());
583 $this->assertEquals(2, $this->root_object->getAmountOfChildren());
584 $this->assertEquals(1, $child_l->getAmountOfChildren());
585
586 // test recursive moving
587 $this->assertEquals(1, $child_m->getAmountOfChildren());
588
589 $child_m->moveTo($child_r);
590
591 $m_children = $child_m->getChildren();
592 $first_third_node = $m_children[0];
593
594 $this->assertEquals(3, $child_m->getDepth());
595 $this->assertEquals(1, $child_m->getAmountOfChildren());
596 $this->assertNotNull($first_third_node);
597 $this->assertEquals(4, $first_third_node->getDepth());
598 $this->assertEquals($child_m->getId(), $first_third_node->getParent()->getId());
599
600 $this->assertEquals(1, $this->root_object->getAmountOfChildren());
601 $this->assertEquals(3, count(ilObjStudyProgramme::getAllChildren($child_l->getRefId())));
602 }
603
608 {
609 $this->createSmallTree();
610 $children = $this->root_object->getChildren();
611 $child_l = $children[0];
612 $child_r = $children[1];
613 $this->root_object->setStatus(ilStudyProgrammeSettings::STATUS_ACTIVE);
614 $child_l->setStatus(ilStudyProgrammeSettings::STATUS_ACTIVE);
615 $child_r->setStatus(ilStudyProgrammeSettings::STATUS_ACTIVE);
616
617 $user = new ilObjUser();
618 $user->create();
619
620 $child_l->assignUser($user->getId(), 6);
621 $this->root_object->removeNode($child_l);
622 }
623
625 {
626 $this->createSmallTree();
627 $children = $this->root_object->getChildren();
628 $child_l = $children[0];
629 $child_r = $children[1];
630 $this->root_object->setStatus(ilStudyProgrammeSettings::STATUS_ACTIVE);
631 $child_l->setStatus(ilStudyProgrammeSettings::STATUS_ACTIVE);
633
634 $user = new ilObjUser();
635 $user->create();
636
637 $this->root_object->assignUser($user->getId(), 6);
638 $this->root_object->removeNode($child_r);
639 }
640
641 public function testCreateableSubObjects()
642 {
643 $this->createSmallTree();
644 $children = $this->root_object->getChildren();
645 $child_l = $children[0];
646
647 $all_possible_subobjects = $this->root_object->getPossibleSubObjects();
648 // don't take rolfs into account, we don't need rolf anymore
649 unset($all_possible_subobjects["rolf"]);
650
651 // this is course reference and training programme
652 $this->assertCount(3, $all_possible_subobjects);
653 $this->assertArrayHasKey("prg", $all_possible_subobjects);
654 $this->assertArrayHasKey("crsr", $all_possible_subobjects);
655 $this->assertArrayHasKey("prgr", $all_possible_subobjects);
656 // root already contains program nodes, so course ref is forbidden
657 $subobjs = ilObjStudyProgramme::getCreatableSubObjects($all_possible_subobjects, $this->root_object->getRefId());
658 $this->assertCount(2, $subobjs);
659 $this->assertArrayHasKey("prg", $subobjs);
660 $this->assertArrayHasKey("prgr", $all_possible_subobjects);
661 // first node contains nothing, so course ref and program node are allowed
662 $subobjs = ilObjStudyProgramme::getCreatableSubObjects($all_possible_subobjects, $child_l->getRefId());
663 $this->assertCount(3, $subobjs);
664 $this->assertArrayHasKey("prg", $subobjs);
665 $this->assertArrayHasKey("crsr", $subobjs);
666 $this->assertArrayHasKey("prgr", $all_possible_subobjects);
667 $mock_leaf = new ilStudyProgrammeLeafMock();
668 $children = $this->root_object->getChildren();
669 $child_l->object_factory = new ilObjectFactoryWrapperMock();
670 $child_l->addLeaf($mock_leaf);
671
672 // Now we added a leaf, so no program nodes are allowed anymore.
673 $subobjs = ilObjStudyProgramme::getCreatableSubObjects($all_possible_subobjects, $child_l->getRefId());
674 $this->assertCount(1, $subobjs);
675 $this->assertArrayHasKey("crsr", $subobjs);
676 }
677
679 {
680 $all_possible_subobjects = $this->obj_definition->getSubObjects("prg");
681 // don't take rolfs into account, we don't need rolf anymore
682 unset($all_possible_subobjects["rolf"]);
683 $this->assertEquals(
684 $all_possible_subobjects,
685 ilObjStudyProgramme::getCreatableSubObjects($all_possible_subobjects, null)
686 );
687 }
688
693 {
695 }
696
698 {
699 $this->root_object->delete();
700 $this->root_object = null;
701
702 global $DIC;
703 $ilDB = $DIC['ilDB'];
704 $res = $ilDB->query(
705 "SELECT COUNT(*) cnt "
707 . " WHERE obj_id = " . $this->root_object_obj_id
708 );
709 $rec = $ilDB->fetchAssoc($res);
710 $this->assertEquals(0, $rec["cnt"]);
711 }
712
714 {
715 // Ask for permission id for creation of "foobar" to check assumption
716 // that lookupCreateOperationIds just drops unknown object types.
717 $op_ids = ilRbacReview::lookupCreateOperationIds(array("prg", "foobar"));
718 $this->assertCount(1, $op_ids);
719 }
720}
An exception for terminatinating execution or to throw for unit testing.
TestCase for the ilObjStudyProgramme @group needsInstalledILIAS.
testTreeDepth()
Test getDepth on ilObjStudyProgramme.
testApplyToSubTreeNodes()
Test applyToSubTreeNodes on ilObjStudyProgramme.
testLoadByObjId()
Test loading of ilObjStudyProgramme with obj_id.
testRemoveLeaf()
Test on removeLead.
testDelete()
Test deletion of a ilObjStudyProgramme.
testTreeGetChildren()
Test function to get children or information about them.
testCreation()
Test creation of ilObjStudyProgramme.
testTreeCreation()
Test creating a small tree.
testCantRemoveNodeWithRelevantProgress()
@expectedException ilStudyProgrammeTreeException
testTreeGetParents()
@depends testTreeCreation
testAddWrongChildType()
Test whether nodes can only be added when there is no leaf in the parent and vice versa.
testRemoveNode()
Test on removeNode.
testCreatableSubObjectsRaisesOnNonProgramRef()
@expectedException ilException
createSmallTree()
Creates a small tree, used by various tests.
testSettings()
Test settings on ilObjStudyProgramme.
testLoadByRefId()
Test loading of ilObjStudyProgramme with ref_id.
testGetInstanceByRefId()
Test loading over getInstance.
testTreeGetRoot()
Test getRoot on ilObjStudyProgramme.
testTreeGetParent()
Test getParent on ilObjStudyProgramme.
static getInstanceByRefId($a_ref_id)
static getCreatableSubObjects(array $a_subobjects, $a_ref_id)
Filter the list of possible subobjects for the objects that actually could be created on a concrete n...
static getAllChildren(int $a_ref_id, bool $include_references=false)
Get a list of all ilObjStudyProgrammes in the subtree starting at $a_ref_id.
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.
Mock for object factory.
Definition: mocks.php:69
static lookupCreateOperationIds($a_type_arr)
Lookup operation ids.
Mock classes for tests.
Definition: mocks.php:21
Exception is thrown when invariants on the program tree would be violated by manipulation of tree.
foreach($_POST as $key=> $value) $res
global $ilDB
$DIC
Definition: xapitoken.php:46