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.assSingleChoice.php';
61 $sc =
new assSingleChoice(
'unit test single choice question',
'unit test single choice question comment',
'Helmut Schottmüller', -1,
'<p>is a <strong>unit test</strong> required?</p>');
74 $sc->setObjId($obj_id);
88 include_once
'./Modules/TestQuestionPool/classes/class.assSingleChoice.php';
90 $this->assertGreaterThan(0, $insert_id);
94 $sc->loadFromDb($insert_id);
95 $this->assertEquals($sc->getPoints(),1);
96 $this->assertEquals($sc->getTitle(),
"unit test single choice question");
97 $this->assertEquals($sc->getComment(),
"unit test single choice question comment");
98 $this->assertEquals($sc->getAuthor(),
"Helmut Schottmüller");
99 $this->assertEquals($sc->getQuestion(),
"<p>is a <strong>unit test</strong> required?</p>");
100 $this->assertEquals(count($sc->getAnswers()), 2);
101 $result = $sc->delete($insert_id);
102 $this->assertEquals(
$result,
true);