19 if (defined(
'ILIAS_PHPUNIT_CONTEXT'))
21 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
22 ilUnitUtil::performInitialisation();
26 chdir( dirname( __FILE__ ) );
39 $obj_id = ($obj_id) ? $obj_id : 99999999;
40 include_once
'./Modules/TestQuestionPool/classes/class.assMultipleChoice.php';
42 $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>');
67 $mc->setObjId($obj_id);
81 include_once
'./Modules/TestQuestionPool/classes/class.assMultipleChoice.php';
83 $this->assertGreaterThan(0, $insert_id);
87 $mc->loadFromDb($insert_id);
88 $this->assertEquals($mc->getPoints(),2);
89 $this->assertEquals($mc->getTitle(),
"unit test multiple choice question");
90 $this->assertEquals($mc->getComment(),
"unit test multiple choice question comment");
91 $this->assertEquals($mc->getAuthor(),
"Helmut Schottmüller");
92 $this->assertEquals($mc->getQuestion(),
"<p><strong>unit tests</strong> are...</p>");
93 $this->assertEquals(count($mc->getAnswers()), 4);
94 $result = $mc->delete($insert_id);
95 $this->assertEquals(
$result,
true);