Question creation test.
65 {
67
68 include_once './Modules/TestQuestionPool/classes/class.assSingleChoice.php';
69 $insert_id = ilassSingleChoiceTest::createSampleQuestion();
70 $this->assertGreaterThan(0, $insert_id);
71 if ($insert_id > 0)
72 {
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);
83 }
84 }