39 if (defined(
'ILIAS_PHPUNIT_CONTEXT'))
41 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
42 ilUnitUtil::performInitialisation();
46 chdir( dirname( __FILE__ ) );
59 $obj_id = ($obj_id) ? $obj_id : 99999999;
60 include_once
'./Modules/TestQuestionPool/classes/class.assMultipleChoice.php';
62 $mc =
new assMultipleChoice(
'unit test multiple choice question',
'unit test multiple choice question comment',
'Helmut Schottmüller', -1,
'<p><strong>unit tests</strong> are...</p>');
87 $mc->setObjId($obj_id);
101 include_once
'./Modules/TestQuestionPool/classes/class.assMultipleChoice.php';
103 $this->assertGreaterThan(0, $insert_id);
107 $mc->loadFromDb($insert_id);
108 $this->assertEquals($mc->getPoints(),2);
109 $this->assertEquals($mc->getTitle(),
"unit test multiple choice question");
110 $this->assertEquals($mc->getComment(),
"unit test multiple choice question comment");
111 $this->assertEquals($mc->getAuthor(),
"Helmut Schottmüller");
112 $this->assertEquals($mc->getQuestion(),
"<p><strong>unit tests</strong> are...</p>");
113 $this->assertEquals(count($mc->getAnswers()), 4);
114 $result = $mc->delete($insert_id);
115 $this->assertEquals(
$result,
true);