5use PHPUnit\Framework\TestCase;
 
    7require_once(__DIR__ . 
"/mocks.php");
 
   20    protected function setUp() : void
 
   22        require_once(
"./Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
 
   23        PHPUnit\Framework\Error\Deprecated::$enabled = 
false;
 
   27            include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
 
   28            ilUnitUtil::performInitialisation();
 
   49            $this->root->delete();
 
   62        if (!array_key_exists(
"points", 
$data)) {
 
   63            throw new Exception(
"Expected to find 'points' in data array.");
 
   66        $top->setPoints(
$data[
"points"]);
 
   68        foreach (
$data as $node_name => $data2) {
 
   69            if ($node_name == 
"points") {
 
   72            if (isset($this->$node_name)) {
 
   73                throw new Exception(
"Node $node_name already exists.");
 
   78                $top->addLeaf($this->$node_name);
 
   82                $top->addNode($this->$node_name);
 
   92        $this->
setUpNodes($this->root, array( 
"points" => 200
 
   93        , 
"node1" => array( 
"points" => 100
 
   97        , 
"node2" => array( 
"points" => 100
 
  104        $user_id = $user->getId();
 
  105        $ass = $this->root->assignUser($user->getId(), 6);
 
  106        $ass_id = $ass->getId();
 
  108        $this->leaf11->markCompletedFor($user_id);
 
  109        $this->leaf21->markCompletedFor($user_id);
 
  118        $this->
setUpNodes($this->root, array( 
"points" => 200
 
  119        , 
"node1" => array( 
"points" => 100
 
  123        , 
"node2" => array( 
"points" => 100
 
  130        $user_id = $user->getId();
 
  131        $ass = $this->root->assignUser($user->getId(), 6);
 
  132        $ass_id = $ass->getId();
 
  134        $this->node1->getProgressForAssignment($ass_id)
 
  135                    ->markAccredited($this->
user->getId());
 
  136        $this->leaf21->markCompletedFor($user_id);
 
  145        $this->
setUpNodes($this->root, array( 
"points" => 200
 
  146        , 
"node1" => array( 
"points" => 100
 
  150        , 
"node2" => array( 
"points" => 100
 
  157        $user_id = $user->getId();
 
  158        $ass = $this->root->assignUser($user->getId(), 6);
 
  159        $ass_id = $ass->getId();
 
  161        $this->node1->getProgressForAssignment($ass_id)
 
  162                    ->markNotRelevant(6);
 
  163        $this->root->getProgressForAssignment($ass_id)
 
  164                   ->setRequiredAmountOfPoints(100, 6);
 
  165        $this->leaf21->markCompletedFor($user_id);
 
  174        $this->
setUpNodes($this->root, array( 
"points" => 200
 
  175        , 
"node1" => array( 
"points" => 100
 
  179        , 
"node2" => array( 
"points" => 100
 
  186        $user_id = $user->getId();
 
  187        $ass = $this->root->assignUser($user->getId(), 6);
 
  188        $ass_id = $ass->getId();
 
  190        $this->node1->getProgressForAssignment($ass_id)
 
  191                    ->markNotRelevant(6);
 
  192        $this->leaf11->markCompletedFor($user_id);
 
  193        $this->leaf21->markCompletedFor($user_id);
 
  202        $this->
setUpNodes($this->root, array( 
"points" => 0
 
  203        , 
"node1" => array( 
"points" => 100
 
  207        , 
"node2" => array( 
"points" => 100
 
  214        $user_id = $user->getId();
 
  215        $ass = $this->root->assignUser($user->getId(), 6);
 
  216        $ass_id = $ass->getId();
 
  220        $this->leaf11->markCompletedFor($user_id);
 
An exception for terminatinating execution or to throw for unit testing.
static createInstance()
Create an instance of ilObjStudyProgramme, put in cache.
TestCase for the assignment of users to a programme.
testInitialProgressOnOptionalNodes()
const STATUS_NOT_RELEVANT