19 require_once
'./Modules/TestQuestionPool/classes/class.assSingleChoice.php';
20 if (
defined(
'ILIAS_PHPUNIT_CONTEXT')) {
21 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
22 ilUnitUtil::performInitialisation();
24 chdir(dirname(__FILE__));
27 require_once
'./Services/Utilities/classes/class.ilUtil.php';
88 $this->assertEquals(
false, $obj->isComplete());
89 $obj->setTitle(
'Tilte');
90 $obj->setAuthor(
'Me or another');
91 $obj->setQuestion(
'My great Question.');
92 $obj->addAnswer(
'Super simple single Choice', 1);
94 $this->assertEquals(
true, $obj->isComplete());
100 $this->assertEquals(
'thumb.', $obj->getThumbPrefix());
106 $obj->setOutputType(0);
107 $this->assertEquals(0, $obj->getOutputType());
113 $this->assertEquals(0, $obj->getAnswerCount());
114 $obj->addAnswer(
'1', 1, 0);
115 $obj->addAnswer(
'1', 1, 1);
116 $this->assertEquals(2, $obj->getAnswerCount());
117 $obj->deleteAnswer(0);
118 $this->assertEquals(1, $obj->getAnswerCount());
124 $obj->addAnswer(
'1', 1, 0);
125 $obj->addAnswer(
'1', 1, 1);
126 $this->assertEquals(2, $obj->getAnswerCount());
127 $obj->flushAnswers();
128 $this->assertEquals(0, $obj->getAnswerCount());
134 $this->assertEquals(
'assSingleChoice', $obj->getQuestionType());
140 $this->assertEquals(
'qpl_qst_sc', $obj->getAdditionalTableName());
146 $this->assertEquals(
'qpl_a_sc', $obj->getAnswerTableName());
test_flushAnswers_shouldClearAnswers()
test_getThumbPrefix_shouldReturnString()
test_isComplete_shouldReturnTrue()
Create a sample question and save it to the database.
test_setOutputType_shouldReturngetOutputType()
Class for single choice questions.
test_getQuestionType_shouldReturnQuestionType()
test_getAdditionalTableName_shouldReturnAdditionalTableName()
Unit tests for single choice questions.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
test_getAnswerTableName_shouldReturnAnswerTableName()
test_getAnswerCount_shouldReturnCount()