5use PHPUnit\Framework\TestCase;
 
    7require_once(__DIR__ . 
"/mocks.php");
 
   21    protected function setUp() : void
 
   23        require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
 
   24        PHPUnit\Framework\Error\Deprecated::$enabled = 
false;
 
   28            include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
 
   30                ilUnitUtil::performInitialisation();
 
   31            } 
catch (Exception 
$e) {
 
   45        $this->root->addNode($this->node1);
 
   46        $this->root->addNode($this->node2);
 
   47        $this->node1->addLeaf($this->leaf1);
 
   48        $this->node2->addLeaf($this->leaf2);
 
   62            $this->root->delete();
 
   83        return array($this->root->assignUser($user->getId(), 6), $user);
 
   93        $root_progresses = $this->root->getProgressesOf($user->getId());
 
   94        $this->assertCount(1, $root_progresses);
 
   95        $root_progress = $root_progresses[0];
 
   97        $this->assertEquals($this->root->getPoints(), $root_progress->getAmountOfPoints());
 
   98        $this->assertEquals(0, $root_progress->getCurrentAmountOfPoints());
 
   99        $this->assertEquals($this->root->getId(), $root_progress->getStudyProgramme()->getId());
 
  100        $this->assertEquals($ass->getId(), $root_progress->getAssignmentId());
 
  101        $this->assertEquals($user->getId(), $root_progress->getUserId());
 
  102        $this->assertNull($root_progress->getLastChangeBy());
 
  103        $this->assertNull($root_progress->getCompletionBy());
 
  104        $this->assertNull($root_progress->getCompletionDate());
 
  105        $this->assertEquals($root_progress->getAssignmentDate()->format(
'Y-m-d'), (
new \DateTime())->format(
'Y-m-d'));
 
  108        $node1_progresses = $this->node1->getProgressesOf($user->getId());
 
  109        $this->assertCount(1, $node1_progresses);
 
  110        $node1_progress = $node1_progresses[0];
 
  112        $this->assertEquals($this->node1->getPoints(), $node1_progress->getAmountOfPoints());
 
  113        $this->assertEquals(0, $node1_progress->getCurrentAmountOfPoints());
 
  114        $this->assertEquals($this->node1->getId(), $node1_progress->getStudyProgramme()->getId());
 
  115        $this->assertEquals($ass->getId(), $node1_progress->getAssignmentId());
 
  116        $this->assertEquals($user->getId(), $node1_progress->getUserId());
 
  117        $this->assertNull($node1_progress->getLastChangeBy());
 
  118        $this->assertNull($node1_progress->getCompletionBy());
 
  120        $node2_progresses = $this->node2->getProgressesOf($user->getId());
 
  121        $this->assertCount(1, $node2_progresses);
 
  122        $node2_progress = $node2_progresses[0];
 
  124        $this->assertEquals($this->node2->getPoints(), $node2_progress->getAmountOfPoints());
 
  125        $this->assertEquals(0, $node2_progress->getCurrentAmountOfPoints());
 
  126        $this->assertEquals($this->node2->getId(), $node2_progress->getStudyProgramme()->getId());
 
  127        $this->assertEquals($ass->getId(), $node2_progress->getAssignmentId());
 
  128        $this->assertEquals($user->getId(), $node2_progress->getUserId());
 
  129        $this->assertNull($node2_progress->getLastChangeBy());
 
  130        $this->assertNull($node2_progress->getCompletionBy());
 
  143        $root_progresses = $this->root->getProgressesOf($user->getId());
 
  144        $root_progress = $root_progresses[0];
 
  147        $node1_progresses = $this->node1->getProgressesOf($user->getId());
 
  148        $node1_progress = $node1_progresses[0];
 
  151        $node2_progresses = $this->node2->getProgressesOf($user->getId());
 
  152        $node2_progress = $node2_progresses[0];
 
  166        $root_progresses = $this->root->getProgressesOf($user->getId());
 
  167        $root_progress = $root_progresses[0];
 
  170        $node1_progresses = $this->node1->getProgressesOf($user->getId());
 
  171        $node1_progress = $node1_progresses[0];
 
  174        $node2_progresses = $this->node2->getProgressesOf($user->getId());
 
  175        $node2_progress = $node2_progresses[0];
 
  187        $root_progresses = $this->root->getProgressesOf($user->getId());
 
  188        $this->assertCount(1, $root_progresses);
 
  199        $USER_ID = $user2->getId();
 
  201        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  202        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  203        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  208        $ts_before_change = $node2_progress->getLastChange()->format(
'Y-m-d H:i:s');
 
  209        $node2_progress->markAccredited($USER_ID);
 
  210        $ts_after_change = $node2_progress->getLastChange()->format(
'Y-m-d H:i:s');
 
  213        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  214        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  215        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  217        $this->assertTrue($node2_progress->isSuccessful());
 
  218        $this->assertEquals($root_progress->getAmountOfPoints(), $root_progress->getCurrentAmountOfPoints());
 
  221        $this->assertEquals((
new \DateTime())->format(
'Y-m-d'), $root_progress->getCompletionDate()->format(
'Y-m-d'));
 
  223        $this->assertNull($node1_progress->getCompletionDate());
 
  225        $this->assertEquals((
new \DateTime())->format(
'Y-m-d'), $node2_progress->getCompletionDate()->format(
'Y-m-d'));
 
  226        $this->assertEquals($USER_ID, $node2_progress->getCompletionBy());
 
  227        $this->assertLessThanOrEqual($ts_before_change, $ts_after_change);
 
  238        $USER_ID = $user2->getId();
 
  240        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  241        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  242        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  248        $ts_before_change = $node2_progress->getLastChange()->format(
'Y-m-d H:i:s');
 
  249        $node2_progress->markAccredited($USER_ID);
 
  250        $node2_progress->unmarkAccredited();
 
  251        $ts_after_change = $node2_progress->getLastChange()->format(
'Y-m-d H:i:s');
 
  258        $this->assertNull($root_progress->getCompletionDate());
 
  259        $this->assertNull($node1_progress->getCompletionDate());
 
  260        $this->assertNull($node2_progress->getCompletionDate());
 
  261        $this->assertEquals(
null, $node2_progress->getCompletionBy());
 
  262        $this->assertLessThanOrEqual($ts_before_change, $ts_after_change);
 
  273        $USER_ID = $user2->getId();
 
  275        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  276        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  277        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  278        $node2_progress->markFailed($USER_ID);
 
  283        $this->assertNull($root_progress->getCompletionDate());
 
  284        $this->assertNull($node1_progress->getCompletionDate());
 
  285        $this->assertNull($node2_progress->getCompletionDate());
 
  296        $USER_ID = (int) $user2->getId();
 
  298        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  299        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  300        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  301        $node2_progress->markFailed($USER_ID);
 
  306        $this->assertNull($root_progress->getCompletionDate());
 
  307        $this->assertNull($node1_progress->getCompletionDate());
 
  308        $this->assertNull($node2_progress->getCompletionDate());
 
  309        $node2_progress->markNotFailed($USER_ID);
 
  322        $USER_ID = $user2->getId();
 
  324        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  325        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  326        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  327        $ts_before_change = $node2_progress->getLastChange()->format(
'Y-m-d H:i:s');
 
  328        $node2_progress->markNotRelevant($USER_ID);
 
  329        $ts_after_change = $node2_progress->getLastChange()->format(
'Y-m-d H:i:s');
 
  333        $this->assertNull($root_progress->getCompletionDate());
 
  334        $this->assertNull($node1_progress->getCompletionDate());
 
  335        $this->assertNull($node2_progress->getCompletionDate());
 
  336        $this->assertEquals($USER_ID, $node2_progress->getCompletionBy());
 
  337        $this->assertLessThanOrEqual($ts_before_change, $ts_after_change);
 
  338        $this->assertTrue($node2_progress->hasIndividualModifications());
 
  350        $this->root->addNode($node3);
 
  352        $node3_progress = array_shift($node3->getProgressesOf($user->getId()));
 
  353        $this->assertNotNull($node3_progress);
 
  365        $NEW_AMOUNT_OF_POINTS_1 = 205;
 
  368        $node2_progress1 = array_shift($this->node2->getProgressesOf($user1->getId()));
 
  369        $node2_progress1->setRequiredAmountOfPoints($NEW_AMOUNT_OF_POINTS_1, 6);
 
  371        $this->assertEquals($NEW_AMOUNT_OF_POINTS_1, $node2_progress1->getAmountOfPoints());
 
  381        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  382        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  383        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  397        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  398        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  399        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  413        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  414        $node1_progress = array_shift($this->node1->getProgressesOf($user->getId()));
 
  415        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  417        $this->assertTrue($root_progress->canBeCompleted());
 
  418        $this->assertTrue($node1_progress->canBeCompleted());
 
  419        $this->assertTrue($node2_progress->canBeCompleted());
 
  424        $NEW_AMOUNT_OF_POINTS = 3003;
 
  428        $this->root->setPoints($NEW_AMOUNT_OF_POINTS)
 
  434        $this->assertLessThan($NEW_AMOUNT_OF_POINTS, $this->node1->getPoints() + $this->node2->getPoints());
 
  436        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  437        $this->assertFalse($root_progress->canBeCompleted());
 
  442        $NEW_AMOUNT_OF_POINTS = 3003;
 
  447        $this->root->addNode($node3);
 
  448        $node3->setPoints($NEW_AMOUNT_OF_POINTS)
 
  457        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  458        $node3_progress = array_shift($node3->getProgressesOf($user->getId()));
 
  460        $this->assertFalse($root_progress->canBeCompleted());
 
  461        $this->assertFalse($node3_progress->canBeCompleted());
 
  473        $root_progresses = $this->root->getProgressesOf($user->getId());
 
  474        $this->assertCount(0, $root_progresses);
 
  475        $node1_progresses = $this->node1->getProgressesOf($user->getId());
 
  476        $this->assertCount(0, $node1_progresses);
 
  477        $node2_progresses = $this->node2->getProgressesOf($user->getId());
 
  478        $this->assertCount(0, $node2_progresses);
 
  489        $NEW_AMOUNT_OF_POINTS = 201;
 
  492        $this->root->setPoints($NEW_AMOUNT_OF_POINTS)
 
  495        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  508        $NEW_AMOUNT_OF_POINTS = 202;
 
  511        $this->root->setPoints($NEW_AMOUNT_OF_POINTS)
 
  514        $ass->updateFromProgram();
 
  515        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  516        $this->assertEquals($NEW_AMOUNT_OF_POINTS, $root_progress->getAmountOfPoints());
 
  529        $NEW_AMOUNT_OF_POINTS = 203;
 
  532        $this->root->setPoints($NEW_AMOUNT_OF_POINTS)
 
  535        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  536        $ass->updateFromProgram();
 
  537        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  538        $this->assertEquals($NEW_AMOUNT_OF_POINTS, $root_progress->getAmountOfPoints());
 
  555        $NEW_AMOUNT_OF_POINTS_1 = 205;
 
  557        $NEW_AMOUNT_OF_POINTS_2 = 206;
 
  559        $this->assertNotEquals($NEW_AMOUNT_OF_POINTS_1, $NEW_AMOUNT_OF_POINTS_2);
 
  561        $node2_progress1 = array_shift($this->node2->getProgressesOf($user1->getId()));
 
  564        $node2_progress2 = array_shift($this->node2->getProgressesOf($user2->getId()));
 
  566        $node2_progress1->setRequiredAmountOfPoints($NEW_AMOUNT_OF_POINTS_1, 6);
 
  567        $this->assertEquals($NEW_AMOUNT_OF_POINTS_1, $node2_progress1->getAmountOfPoints());
 
  568        $node2_progress1 = array_shift($this->node2->getProgressesOf($user1->getId()));
 
  569        $this->assertEquals($NEW_AMOUNT_OF_POINTS_1, $node2_progress1->getAmountOfPoints());
 
  570        $this->node2->setPoints($NEW_AMOUNT_OF_POINTS_2)
 
  572        $this->root->updateAllAssignments();
 
  573        $node2_progress2 = array_shift($this->node2->getProgressesOf($user2->getId()));
 
  575        $this->assertEquals($NEW_AMOUNT_OF_POINTS_2, $node2_progress2->getAmountOfPoints());
 
  578        $node2_progress2 = array_shift($this->node2->getProgressesOf($user2->getId()));
 
  581        $this->assertEquals($NEW_AMOUNT_OF_POINTS_2, $node2_progress2->getAmountOfPoints());
 
  598        $progress = $this->node1->getProgressForAssignment($ass1->getId());
 
  600        $progress->markAccredited($this->
user->getId());
 
  612        $progress = $this->node1->getProgressForAssignment($ass1->getId());
 
  613        $this->assertFalse($progress->hasIndividualModifications());
 
  623        $progress = $this->node1->getProgressForAssignment($ass1->getId());
 
  624        $progress->setRequiredAmountOfPoints(1000, 6);
 
  625        $this->assertTrue($progress->hasIndividualModifications());
 
  635        $progress = $this->node1->getProgressForAssignment($ass1->getId());
 
  636        $progress->markNotRelevant(6);
 
  637        $this->assertTrue($progress->hasIndividualModifications());
 
  647        $progress = $this->node1->getProgressForAssignment($ass1->getId());
 
  648        $progress->markAccredited($this->
user->getId());
 
  649        $this->assertFalse($progress->hasIndividualModifications());
 
  660        $USER_ID = $user2->getId();
 
  662        $this->node1->setTitle(
"node1");
 
  663        $this->node1->update();
 
  664        $this->node2->setTitle(
"node2");
 
  665        $this->node2->update();
 
  667        $names = $this->root->getProgressForAssignment($ass->getId())
 
  668                    ->getNamesOfCompletedOrAccreditedChildren();
 
  669        $this->assertEquals($names, array());
 
  671        $this->node1->getProgressForAssignment($ass->getId())->markAccredited($USER_ID);
 
  672        $names = $this->root->getProgressForAssignment($ass->getId())
 
  673                    ->getNamesOfCompletedOrAccreditedChildren();
 
  674        $this->assertEquals($names, array(
"node1"));
 
  676        $this->node2->getProgressForAssignment($ass->getId())->markAccredited($USER_ID);
 
  677        $names = $this->root->getProgressForAssignment($ass->getId())
 
  678                    ->getNamesOfCompletedOrAccreditedChildren();
 
  679        $this->assertEquals($names, array(
"node1", 
"node2"));
 
  689        $depth1->addNode($depth2);
 
  690        $depth2->addNode($depth3);
 
  691        $depth3->addNode($depth4);
 
  699        $assignment = $depth1->assignUser($user->getId(), 6);
 
  700        $progress4 = $depth4->getProgressForAssignment($assignment->getId());
 
  701        $progress4->markAccredited(6);
 
  703        $progress1 = $depth1->getProgressForAssignment($assignment->getId());
 
  704        $progress2 = $depth2->getProgressForAssignment($assignment->getId());
 
  705        $progress3 = $depth3->getProgressForAssignment($assignment->getId());
 
  707        $this->assertTrue($progress1->isSuccessful());
 
  708        $this->assertTrue($progress2->isSuccessful());
 
  709        $this->assertTrue($progress3->isSuccessful());
 
  710        $this->assertTrue($progress4->isSuccessful());
 
  723            ilStudyProgrammeUserProgress::ACTION_SHOW_INDIVIDUAL_PLAN,
 
  724            ilStudyProgrammeUserProgress::ACTION_REMOVE_USER
 
  728            ilStudyProgrammeUserProgress::getPossibleActions(
 
  737            ilStudyProgrammeUserProgress::ACTION_SHOW_INDIVIDUAL_PLAN,
 
  738            ilStudyProgrammeUserProgress::ACTION_REMOVE_USER,
 
  739            ilStudyProgrammeUserProgress::ACTION_MARK_ACCREDITED
 
  743            ilStudyProgrammeUserProgress::getPossibleActions(
 
  752            ilStudyProgrammeUserProgress::ACTION_SHOW_INDIVIDUAL_PLAN,
 
  753            ilStudyProgrammeUserProgress::ACTION_REMOVE_USER,
 
  754            ilStudyProgrammeUserProgress::ACTION_UNMARK_ACCREDITED
 
  758            ilStudyProgrammeUserProgress::getPossibleActions(
 
  767            ilStudyProgrammeUserProgress::ACTION_UNMARK_ACCREDITED
 
  771            ilStudyProgrammeUserProgress::getPossibleActions(
 
  788        $inst = $sp_user_progress_db->getInstance(
 
  790            $this->root->getId(),
 
  793        $this->assertInstanceOf(ilStudyProgrammeUserProgress::class, $inst);
 
  795            $this->root->getProgressesOf($user->getId()),
 
  796            $sp_user_progress_db->getInstancesForUser($this->root->getId(), $user->getId())
 
  799        $up = $this->root->getProgressesOf($user->getId())[0];
 
  802            $sp_user_progress_db->getInstanceById($up->getId())
 
  810            $sp_user_progress_db->getInstanceById(-1);
 
  811            $this->assertFalse(
"This should not happen");
 
  813            $this->assertTrue(
true);
 
  818            $sp_user_progress_db->getInstancesForAssignment(-1);
 
  819            $this->assertFalse(
"This should not happen");
 
  821            $this->assertTrue(
true);
 
  832        $prg1->addNode($prg2);
 
  833        $prg1->setValidityOfQualificationPeriod(100);
 
  842        $assignment = $prg1->assignUser($user->getId(), 6);
 
  843        $progress2 = $prg2->getProgressForAssignment($assignment->getId());
 
  844        $progress2->markAccredited(6);
 
  846        $progress1 = $prg1->getProgressForAssignment($assignment->getId());
 
  847        $progress2 = $prg2->getProgressForAssignment($assignment->getId());
 
  849        $this->assertTrue($progress1->isSuccessful());
 
  850        $this->assertTrue($progress2->isSuccessful());
 
  851        $val_date = 
new DateTime();
 
  852        $val_date->add(
new DateInterval(
'P100D'));
 
  854            $val_date->format(
'Ymd'),
 
  855            $progress1->getValidityOfQualification()->format(
'Ymd')
 
  857        $this->assertNull($progress2->getValidityOfQualification());
 
  867        $prg1->addNode($prg2);
 
  868        $val_date_ref = 
new DateTime();
 
  869        $val_date_ref->add(
new DateInterval(
'P100D'));
 
  870        $prg1->setValidityOfQualificationDate($val_date_ref);
 
  879        $assignment = $prg1->assignUser($user->getId(), 6);
 
  880        $progress2 = $prg2->getProgressForAssignment($assignment->getId());
 
  881        $progress2->markAccredited(6);
 
  883        $progress1 = $prg1->getProgressForAssignment($assignment->getId());
 
  884        $progress2 = $prg2->getProgressForAssignment($assignment->getId());
 
  886        $this->assertTrue($progress1->isSuccessful());
 
  887        $this->assertTrue($progress2->isSuccessful());
 
  889            $val_date_ref->format(
'Ymd'),
 
  890            $progress1->getValidityOfQualification()->format(
'Ymd')
 
  901        $prg1->setValidityOfQualificationPeriod(100);
 
  908        $assignment = $prg1->assignUser($user->getId(), 6);
 
  909        $progress1 = $prg1->getProgressForAssignment($assignment->getId());
 
  910        $progress1->markAccredited(6);
 
  912        $progress1 = $prg1->getProgressForAssignment($assignment->getId());
 
  914        $this->assertTrue($progress1->isSuccessful());
 
  915        $val_date = 
new DateTime();
 
  916        $val_date->add(
new DateInterval(
'P100D'));
 
  917        $this->assertEquals($val_date->format(
'Ymd'), $progress1->getValidityOfQualification()->format(
'Ymd'));
 
  927        $prg1->addNode($prg2);
 
  928        $val_date_ref = 
new DateTime();
 
  929        $val_date_ref->add(
new DateInterval(
'P1D'));
 
  930        $prg1->setValidityOfQualificationDate($val_date_ref);
 
  939        $assignment = $prg1->assignUser($user->getId(), 6);
 
  940        $progress1 = $prg2->getProgressForAssignment($assignment->getId());
 
  941        $this->assertFalse($progress1->isSuccessfulExpired());
 
  942        $progress2 = $prg2->getProgressForAssignment($assignment->getId());
 
  943        $progress2->markAccredited(6);
 
  945        $progress1 = $prg1->getProgressForAssignment($assignment->getId());
 
  947            $val_date_ref->format(
'Ymd'),
 
  948            $progress1->getValidityOfQualification()->format(
'Ymd')
 
  950        $this->assertTrue($progress1->isSuccessful());
 
  951        $this->assertFalse($progress1->isSuccessfulExpired());
 
  953            $progress1->markFailed(6);
 
  954            $this->assertFalse(
'did not throw');
 
  956            $this->assertTrue(
true);
 
  967        $prg1->addNode($prg2);
 
  968        $val_date_ref = 
new DateTime();
 
  969        $val_date_ref->sub(
new DateInterval(
'P1D'));
 
  970        $prg1->setValidityOfQualificationDate($val_date_ref);
 
  979        $assignment = $prg1->assignUser($user->getId(), 6);
 
  980        $progress1 = $prg2->getProgressForAssignment($assignment->getId());
 
  981        $this->assertFalse($progress1->isSuccessfulExpired());
 
  982        $progress2 = $prg2->getProgressForAssignment($assignment->getId());
 
  983        $progress2->markAccredited(6);
 
  985        $progress1 = $prg1->getProgressForAssignment($assignment->getId());
 
  987            $val_date_ref->format(
'Ymd'),
 
  988            $progress1->getValidityOfQualification()->format(
'Ymd')
 
  990        $this->assertTrue($progress1->isSuccessful());
 
  991        $this->assertTrue($progress1->isSuccessfulExpired());
 
  993            $progress1->invalidate();
 
  994            $this->assertTrue(
true);
 
  996            $this->assertFalse(
'did throw');
 
  998        $this->assertTrue($progress1->isSuccessful());
 
  999        $this->assertTrue($progress1->isInvalidated());
 
 1010        $prg1->addNode($prg2);
 
 1019        $assignment = $prg1->assignUser($user->getId(), 6);
 
 1020        $progress1 = $prg2->getProgressForAssignment($assignment->getId());
 
 1021        $this->assertFalse($progress1->isSuccessfulExpired());
 
 1022        $progress2 = $prg2->getProgressForAssignment($assignment->getId());
 
 1023        $progress2->markAccredited(6);
 
 1025        $progress1 = $prg1->getProgressForAssignment($assignment->getId());
 
 1026        $this->assertNull($progress1->getValidityOfQualification());
 
 1027        $this->assertTrue($progress1->isSuccessful());
 
 1028        $this->assertFalse($progress1->isSuccessfulExpired());
 
 1030            $progress1->invalidate();
 
 1031            $this->assertFalse(
'did not throw');
 
 1033            $this->assertTrue(
true);
 
 1035        $this->assertFalse($progress1->isInvalidated());
 
An exception for terminatinating execution or to throw for unit testing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.
Exception is thrown when a progress for some programme node and assignment is missing.
const STATUS_NOT_RELEVANT
TestCase for the progress of users at a programme.
testHasDeviationToProgram1()
testHasDeviationToProgram3()
test_limited_validity_period()
testOutdatedNodesCantBeSetToRelevant()
QUA-Objekte, welche "Inaktiv" sind können bei Studierenden-Studienplänen nicht von "nicht relevant" a...
testGetNamesOfCompletedOrAccreditedChildren()
test_limited_validity_accredited()
testHasDeviationToProgram2()
testNoImplicitPointUpdate()
testNewNodesAreNotRelevant()
testHasDeviationToProgram4()
test_set_failed_no_limited_validity()
testExplicitPointUpdate2()
testIndividualRequiredPoints()
testInitialProgressDraft()
testInitialProgressActive()
testExplicitPointUpdate1()
test_limited_validity_date()
testMaximimPossibleAmountOfPoints1()
testNoUpdateOnModifiedNodes()
test_set_failed_limited_validity_future()
testCompletionOnDeeplyNestedProgresses()
testInitialProgressOutdated()
testUserDeletionDeletesAssignments()
testMaximimPossibleAmountOfPoints2()
test_set_failed_limited_validity_past()