◆ setUp()
ilPrgRestartAssignmentsCronJobTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 63 of file ilPrgRestartAssignmentsCronJobTest.php.
65 $this->events =
new ProgrammeEventsMock();
67 $this->settings_repo = $this->getMockBuilder(ilStudyProgrammeSettingsDBRepository::class)
68 ->disableOriginalConstructor()
69 ->onlyMethods([
'getProgrammeIdsWithReassignmentForExpiringValidity'])
72 $this->adapter = $this->getMockBuilder(ilPrgRestart::class)
73 ->setConstructorArgs([$this->settings_repo, $this->events])
76 $this->real_adapter =
new ilPrgRestart($this->settings_repo, $this->events);
78 $this->assignment_repo = $this->getMockBuilder(ilPRGAssignmentDBRepository::class)
79 ->disableOriginalConstructor()
80 ->onlyMethods([
'getAboutToExpire',
'store'])
83 $this->prg = $this->getMockBuilder(ilObjStudyProgramme::class)
84 ->disableOriginalConstructor()
85 ->onlyMethods([
'getApplicableMembershipSourceForUser',
'getSettings',
'assignUser',
'getRefIdFor'])
◆ testRestartAssignmentsEvents()
ilPrgRestartAssignmentsCronJobTest::testRestartAssignmentsEvents |
( |
| ) |
|
Definition at line 175 of file ilPrgRestartAssignmentsCronJobTest.php.
References ilPrgRestartAssignmentsCronJob\run(), and ilPRGProgress\STATUS_COMPLETED.
180 ->withManuallyAssigned(
true);
183 ->expects($this->once())
184 ->method(
'getProgrammeIdsWithReassignmentForExpiringValidity')
190 $this->assignment_repo
191 ->expects($this->once())
192 ->method(
'getAboutToExpire')
193 ->willReturn([$ass1, $ass2]);
195 ->expects($this->exactly(2))
196 ->method(
'assignUser')
197 ->will($this->onConsecutiveCalls($ass1, $ass2));
202 $this->assertEquals(2, count(
$job->logs));
204 [
'userReAssigned', [
"ass_id" => 42,
'root_prg_id' => 11]],
205 [
'userReAssigned', [
"ass_id" => 43,
'root_prg_id' => 11]]
207 $this->assertEquals($expected_events, $this->events->raised);
ilPrgRestartAssignmentsCronJobMock $job
A Progress is the status of a user on a single node of an assignment; it is unique by assignment_id:u...
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
◆ testRestartAssignmentsForNoRelevantProgrammes()
ilPrgRestartAssignmentsCronJobTest::testRestartAssignmentsForNoRelevantProgrammes |
( |
| ) |
|
Definition at line 91 of file ilPrgRestartAssignmentsCronJobTest.php.
94 ->expects($this->once())
95 ->method(
'getRelevantProgrammeIds')
97 $this->assignment_repo
98 ->expects($this->never())
99 ->method(
'getAboutToExpire');
100 $this->assignment_repo
101 ->expects($this->never())
104 ->expects($this->never())
105 ->method(
'actOnSingleAssignment');
◆ testRestartAssignmentsForRelevantProgrammes()
ilPrgRestartAssignmentsCronJobTest::testRestartAssignmentsForRelevantProgrammes |
( |
| ) |
|
Definition at line 109 of file ilPrgRestartAssignmentsCronJobTest.php.
References null, and ilPRGProgress\STATUS_COMPLETED.
113 ->withProgressTree($pgs1)
114 ->withManuallyAssigned(
false);
116 ->withProgressTree($pgs1)
117 ->withManuallyAssigned(
true);
119 ->expects($this->once())
120 ->method(
'getRelevantProgrammeIds')
124 $this->assignment_repo
125 ->expects($this->once())
126 ->method(
'getAboutToExpire')
127 ->willReturn([$ass1, $ass2]);
129 $this->assignment_repo
130 ->expects($this->exactly(1))
133 $validity_settings = $this->getMockBuilder(ilStudyProgrammeValidityOfAchievedQualificationSettings::class)
134 ->disableOriginalConstructor()
135 ->onlyMethods([
'getRestartRecheck'])
139 ->expects($this->exactly(2))
140 ->method(
'getRestartRecheck')
143 $settings = $this->getMockBuilder(ilStudyProgrammeSettings::class)
144 ->disableOriginalConstructor()
145 ->onlyMethods([
'getValidityOfQualificationSettings'])
148 ->expects($this->exactly(2))
149 ->method(
'getValidityOfQualificationSettings')
150 ->willReturn($validity_settings);
153 ->expects($this->exactly(2))
154 ->method(
'getSettings')
155 ->willReturn($settings);
158 ->expects($this->exactly(1))
159 ->method(
'getApplicableMembershipSourceForUser')
163 ->expects($this->exactly(1))
164 ->method(
'assignUser')
169 ->expects($this->exactly(1))
170 ->method(
'actOnSingleAssignment');
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
A Progress is the status of a user on a single node of an assignment; it is unique by assignment_id:u...
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
◆ $adapter
◆ $assignment_repo
◆ $events
ProgrammeEventsMock ilPrgRestartAssignmentsCronJobTest::$events |
|
protected |
◆ $job
◆ $prg
◆ $real_adapter
ilPrgRestart ilPrgRestartAssignmentsCronJobTest::$real_adapter |
|
protected |
◆ $settings_repo
The documentation for this class was generated from the following file: