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");
 
   29            ilUnitUtil::performInitialisation();
 
   42        $this->root->addNode($this->node1);
 
   43        $this->root->addNode($this->node2);
 
   44        $this->node1->addLeaf($this->leaf1);
 
   45        $this->node2->addLeaf($this->leaf2);
 
   59            $this->root->delete();
 
   80        return array($this->root->assignUser($user->getId(), 6), $user);
 
   90        require_once(
"Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
   91        require_once(
"Services/Tracking/classes/class.ilLPStatus.php");
 
  116        require_once(
"Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  117        require_once(
"Services/Tracking/classes/class.ilLPStatus.php");
 
  142        require_once(
"Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  143        require_once(
"Services/Tracking/classes/class.ilLPStatus.php");
 
  166        $USER_ID = $user2->getId();
 
  168        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  169        $node2_progress->markAccredited($USER_ID);
 
  171        require_once(
"Services/Tracking/classes/class.ilLPStatusWrapper.php");
 
  172        require_once(
"Services/Tracking/classes/class.ilLPStatus.php");
 
  195        $USER_ID = $user2->getId();
 
  197        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  198        $node2_progress->markAccredited($USER_ID);
 
  205        $node2_progress->unmarkAccredited();
 
  230        $USER_ID = $user2->getId();
 
  232        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  233        $node2_progress->markNotRelevant($USER_ID);
 
  257        $USER_ID = $user2->getId();
 
  259        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  260        $node2_progress->markFailed($USER_ID);
 
  284        $USER_ID = (int) $user2->getId();
 
  286        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  287        $node2_progress->markFailed($USER_ID);
 
  302        $node2_progress->markNotFailed($USER_ID);
 
  318        $this->root->addNode($node3);
 
  320        $node3_progress = array_shift($node3->getProgressesOf($user->getId()));
 
  321        $this->assertNotNull($node3_progress);
 
  332        $yesterday = 
new DateTime();
 
  333        $yesterday->sub(
new DateInterval(
'P1D'));
 
  339        $node2_progress = array_shift($this->node2->getProgressesOf($user->getId()));
 
  340        $node2_progress->markAccredited(6);
 
  350        $progress_repo->update(
 
  351            $progress_repo->getByIds((
int) $this->root->getId(), (
int) $ass->getId(), (
int) $user->getId())
 
  352                ->setValidityOfQualification($yesterday)
 
  355        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  356        $this->assertTrue($root_progress->isSuccessfulExpired());
 
  357        $this->assertFalse($root_progress->isInvalidated());
 
  358        $root_progress->invalidate();
 
  359        $root_progress = array_shift($this->root->getProgressesOf($user->getId()));
 
  360        $this->assertTrue($root_progress->isSuccessfulExpired());
 
  361        $this->assertTrue($root_progress->isInvalidated());
 
An exception for terminatinating execution or to throw for unit testing.
static _determineStatus($a_obj_id, $a_usr_id)
Determine status.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.
TestCase for the learning progress of users at a programme.
testInitialProgressOutdated()
testNewNodesAreNotRelevant()