TestCase for the ilObjStudyProgramme needsInstalledILIAS.
More...
◆ newUser()
ilStudyProgrammeEventsTest::newUser |
( |
| ) |
|
|
protected |
◆ setUp()
ilStudyProgrammeEventsTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 38 of file ilStudyProgrammeEventsTest.php.
References ilStudyProgrammeEvents\$app_event_handler, array, ilObjStudyProgramme\createInstance(), and ilStudyProgramme\STATUS_ACTIVE.
40 PHPUnit_Framework_Error_Deprecated::$enabled =
false;
42 require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
44 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
45 ilUnitUtil::performInitialisation();
48 $this->root_obj_id = $this->root->getId();
49 $this->root_ref_id = $this->root->getRefId();
50 $this->root->putInTree(ROOT_FOLDER_ID);
56 $this->root->addNode($this->node);
59 $this->node->addLeaf($this->leaf);
62 $this->users =
array();
64 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 87 of file ilStudyProgrammeEventsTest.php.
References newUser().
90 $ass = $this->root->assignUser($user->getId());
92 $this->assertCount(1, $this->event_handler_mock->events);
93 $event = array_pop($this->event_handler_mock->events);
95 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
96 $this->assertEquals(
"userAssigned", $event[
"event"]);
97 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
98 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
99 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
◆ testDeassignUser()
ilStudyProgrammeEventsTest::testDeassignUser |
( |
| ) |
|
Definition at line 102 of file ilStudyProgrammeEventsTest.php.
References array, and newUser().
105 $ass = $this->root->assignUser($user->getId());
106 $this->event_handler_mock->events =
array();
110 $this->assertCount(1, $this->event_handler_mock->events);
112 $event = array_pop($this->event_handler_mock->events);
113 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
114 $this->assertEquals(
"userDeassigned", $event[
"event"]);
115 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
116 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
117 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
Create styles array
The data for the language used.
◆ testUserSuccessfulByAccredited()
ilStudyProgrammeEventsTest::testUserSuccessfulByAccredited |
( |
| ) |
|
Definition at line 147 of file ilStudyProgrammeEventsTest.php.
References array, and newUser().
150 $ass = $this->root->assignUser($user->getId());
151 $this->event_handler_mock->events =
array();
153 $progress = $this->node->getProgressForAssignment($ass->getId());
154 $progress->markAccredited(6);
156 $this->assertCount(2, $this->event_handler_mock->events);
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->node->getId(), $event[
"parameters"][
"prg_id"]);
163 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
164 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
166 $event = array_shift($this->event_handler_mock->events);
167 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
168 $this->assertEquals(
"userSuccessful", $event[
"event"]);
169 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
170 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"prg_id"]);
171 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
172 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
Create styles array
The data for the language used.
◆ testUserSuccessfulByCompletion()
ilStudyProgrammeEventsTest::testUserSuccessfulByCompletion |
( |
| ) |
|
Definition at line 120 of file ilStudyProgrammeEventsTest.php.
References array, and newUser().
123 $ass = $this->root->assignUser($user->getId());
124 $this->event_handler_mock->events =
array();
126 $this->leaf->markCompletedFor($user->getId());
128 $this->assertCount(2, $this->event_handler_mock->events);
130 $event = array_shift($this->event_handler_mock->events);
131 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
132 $this->assertEquals(
"userSuccessful", $event[
"event"]);
133 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
134 $this->assertEquals($this->node->getId(), $event[
"parameters"][
"prg_id"]);
135 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
136 $this->assertEquals($ass->getId(), $event[
"parameters"][
"ass_id"]);
138 $event = array_shift($this->event_handler_mock->events);
139 $this->assertEquals(
"Modules/StudyProgramme", $event[
"component"]);
140 $this->assertEquals(
"userSuccessful", $event[
"event"]);
141 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"root_prg_id"]);
142 $this->assertEquals($this->root->getId(), $event[
"parameters"][
"prg_id"]);
143 $this->assertEquals($user->getId(), $event[
"parameters"][
"usr_id"]);
144 $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: