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.assSingleChoice.php';
41 $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>');
54 $sc->setObjId($obj_id);
68 include_once
'./Modules/TestQuestionPool/classes/class.assSingleChoice.php';
70 $this->assertGreaterThan(0, $insert_id);
74 $sc->loadFromDb($insert_id);
75 $this->assertEquals($sc->getPoints(),1);
76 $this->assertEquals($sc->getTitle(),
"unit test single choice question");
77 $this->assertEquals($sc->getComment(),
"unit test single choice question comment");
78 $this->assertEquals($sc->getAuthor(),
"Helmut Schottmüller");
79 $this->assertEquals($sc->getQuestion(),
"<p>is a <strong>unit test</strong> required?</p>");
80 $this->assertEquals(count($sc->getAnswers()), 2);
81 $result = $sc->delete($insert_id);
82 $this->assertEquals(
$result,
true);