TestCase for the ilObjStudyProgramme needsInstalledILIAS.
More...
◆ newUser()
ilStudyProgrammeEventsTest::newUser |
( |
| ) |
|
|
protected |
◆ setUp()
ilStudyProgrammeEventsTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 37 of file ilStudyProgrammeEventsTest.php.
References ilStudyProgrammeEvents\$app_event_handler, array, ilObjStudyProgramme\createInstance(), and ilStudyProgramme\STATUS_ACTIVE.
38 PHPUnit_Framework_Error_Deprecated::$enabled = FALSE;
40 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
42 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
43 ilUnitUtil::performInitialisation();
46 $this->root_obj_id = $this->root->getId();
47 $this->root_ref_id = $this->root->getRefId();
48 $this->root->putInTree(ROOT_FOLDER_ID);
54 $this->root->addNode($this->node);
57 $this->node->addLeaf($this->leaf);
60 $this->users =
array();
62 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeEvents.php");
static $app_event_handler
Create styles array
The data for the language used.
Mock for ilAppEventHandler.
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.
◆ tearDown()
ilStudyProgrammeEventsTest::tearDown |
( |
| ) |
|
|
protected |
◆ testAssignUser()
ilStudyProgrammeEventsTest::testAssignUser |
( |
| ) |
|
Definition at line 83 of file ilStudyProgrammeEventsTest.php.
References newUser().
85 $ass = $this->root->assignUser($user->getId());
87 $this->assertCount(1, $this->event_handler_mock->events);
88 $event = array_pop($this->event_handler_mock->events);
90 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
91 $this->assertEquals(
"userAssigned", $event[
"event"]);
92 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
93 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
94 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
◆ testDeassignUser()
ilStudyProgrammeEventsTest::testDeassignUser |
( |
| ) |
|
Definition at line 97 of file ilStudyProgrammeEventsTest.php.
References array, and newUser().
99 $ass = $this->root->assignUser($user->getId());
100 $this->event_handler_mock->events =
array();
104 $this->assertCount(1, $this->event_handler_mock->events);
106 $event = array_pop($this->event_handler_mock->events);
107 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
108 $this->assertEquals(
"userDeassigned", $event[
"event"]);
109 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
110 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
111 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
Create styles array
The data for the language used.
◆ testUserSuccessfulByAccredited()
ilStudyProgrammeEventsTest::testUserSuccessfulByAccredited |
( |
| ) |
|
Definition at line 140 of file ilStudyProgrammeEventsTest.php.
References array, and newUser().
142 $ass = $this->root->assignUser($user->getId());
143 $this->event_handler_mock->events =
array();
145 $progress = $this->node->getProgressForAssignment($ass->getId());
146 $progress->markAccredited(6);
148 $this->assertCount(2, $this->event_handler_mock->events);
150 $event = array_shift($this->event_handler_mock->events);
151 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
152 $this->assertEquals(
"userSuccessful", $event[
"event"]);
153 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
154 $this->assertEquals($this->node->getId(), $event[
"parameters"][
"prg_id"]);
155 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
156 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
158 $event = array_shift($this->event_handler_mock->events);
159 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
160 $this->assertEquals(
"userSuccessful", $event[
"event"]);
161 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
162 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"prg_id"]);
163 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
164 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
Create styles array
The data for the language used.
◆ testUserSuccessfulByCompletion()
ilStudyProgrammeEventsTest::testUserSuccessfulByCompletion |
( |
| ) |
|
Definition at line 114 of file ilStudyProgrammeEventsTest.php.
References array, and newUser().
116 $ass = $this->root->assignUser($user->getId());
117 $this->event_handler_mock->events =
array();
119 $this->leaf->markCompletedFor($user->getId());
121 $this->assertCount(2, $this->event_handler_mock->events);
123 $event = array_shift($this->event_handler_mock->events);
124 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
125 $this->assertEquals(
"userSuccessful", $event[
"event"]);
126 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
127 $this->assertEquals($this->node->getId(), $event[
"parameters"][
"prg_id"]);
128 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
129 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
131 $event = array_shift($this->event_handler_mock->events);
132 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
133 $this->assertEquals(
"userSuccessful", $event[
"event"]);
134 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
135 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"prg_id"]);
136 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
137 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
Create styles array
The data for the language used.
◆ $backupGlobals
ilStudyProgrammeEventsTest::$backupGlobals = FALSE |
|
protected |
The documentation for this class was generated from the following file: