3 declare(strict_types=1);
    34         $this->assignment_repo = $repo;
    40         return \DateTimeImmutable::createFromFormat(
'Ymd', 
'20221224');
    43     protected function log(
string $msg): void
    63     protected function setUp(): void
    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'])
    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');
   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')
   158             ->expects($this->exactly(1))
   159             ->method(
'getApplicableMembershipSourceForUser')
   163             ->expects($this->exactly(1))
   164             ->method(
'assignUser')
   169             ->expects($this->exactly(1))
   170             ->method(
'actOnSingleAssignment');
   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);
 
ilPRGAssignmentDBRepository $assignment_repo
 
testRestartAssignmentsForNoRelevantProgrammes()
 
getStudyProgramme(int $prg_obj_id)
 
testRestartAssignmentsEvents()
 
ilPrgRestartAssignmentsCronJobMock $job
 
ilPrgRestart $real_adapter
 
ilPrgCronJobAdapter $adapter
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
A Progress is the status of a user on a single node of an assignment; it is unique by assignment_id:u...
 
testRestartAssignmentsForRelevantProgrammes()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Re-assign users (according to restart-date). 
 
ilStudyProgrammeSettingsDBRepository $settings_repo
 
__construct(ilPRGAssignmentDBRepository $repo, ilPrgCronJobAdapter $adapter, ilObjStudyProgramme $prg)
 
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
 
ProgrammeEventsMock $events