Unit tests for single choice questions.
More...
Unit tests for single choice questions.
- Author
- Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
- Version
- $Id$
Definition at line 13 of file assSingleChoiceTest.php.
◆ setUp()
assSingleChoiceTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 17 of file assSingleChoiceTest.php.
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';
◆ test_flushAnswers_shouldClearAnswers()
assSingleChoiceTest::test_flushAnswers_shouldClearAnswers |
( |
| ) |
|
Definition at line 122 of file assSingleChoiceTest.php.
125 $obj->addAnswer(
'1', 1, 0);
126 $obj->addAnswer(
'1', 1, 1);
127 $this->assertEquals(2, $obj->getAnswerCount());
128 $obj->flushAnswers();
129 $this->assertEquals(0, $obj->getAnswerCount());
Class for single choice questions.
◆ test_getAdditionalTableName_shouldReturnAdditionalTableName()
assSingleChoiceTest::test_getAdditionalTableName_shouldReturnAdditionalTableName |
( |
| ) |
|
Definition at line 138 of file assSingleChoiceTest.php.
141 $this->assertEquals(
'qpl_qst_sc', $obj->getAdditionalTableName());
Class for single choice questions.
◆ test_getAnswerCount_shouldReturnCount()
assSingleChoiceTest::test_getAnswerCount_shouldReturnCount |
( |
| ) |
|
Definition at line 111 of file assSingleChoiceTest.php.
114 $this->assertEquals(0, $obj->getAnswerCount());
115 $obj->addAnswer(
'1', 1, 0);
116 $obj->addAnswer(
'1', 1, 1);
117 $this->assertEquals(2, $obj->getAnswerCount());
118 $obj->deleteAnswer(0);
119 $this->assertEquals(1, $obj->getAnswerCount());
Class for single choice questions.
◆ test_getAnswerTableName_shouldReturnAnswerTableName()
assSingleChoiceTest::test_getAnswerTableName_shouldReturnAnswerTableName |
( |
| ) |
|
Definition at line 144 of file assSingleChoiceTest.php.
147 $this->assertEquals(
'qpl_a_sc', $obj->getAnswerTableName());
Class for single choice questions.
◆ test_getQuestionType_shouldReturnQuestionType()
assSingleChoiceTest::test_getQuestionType_shouldReturnQuestionType |
( |
| ) |
|
Definition at line 132 of file assSingleChoiceTest.php.
135 $this->assertEquals(
'assSingleChoice', $obj->getQuestionType());
Class for single choice questions.
◆ test_getThumbPrefix_shouldReturnString()
assSingleChoiceTest::test_getThumbPrefix_shouldReturnString |
( |
| ) |
|
Definition at line 98 of file assSingleChoiceTest.php.
101 $this->assertEquals(
'thumb.', $obj->getThumbPrefix());
Class for single choice questions.
◆ test_isComplete_shouldReturnTrue()
assSingleChoiceTest::test_isComplete_shouldReturnTrue |
( |
| ) |
|
Create a sample question and save it to the database.
- Parameters
-
integer | $obj_id | Object ID of the containing question pool object (optional) |
- Returns
- integer ID of the newly created question Question creation test
- Parameters
-
Definition at line 86 of file assSingleChoiceTest.php.
89 $this->assertEquals(
false, $obj->isComplete());
90 $obj->setTitle(
'Tilte');
91 $obj->setAuthor(
'Me or another');
92 $obj->setQuestion(
'My great Question.');
93 $obj->addAnswer(
'Super simple single Choice', 1);
95 $this->assertEquals(
true, $obj->isComplete());
Class for single choice questions.
◆ test_setOutputType_shouldReturngetOutputType()
assSingleChoiceTest::test_setOutputType_shouldReturngetOutputType |
( |
| ) |
|
Definition at line 104 of file assSingleChoiceTest.php.
107 $obj->setOutputType(0);
108 $this->assertEquals(0, $obj->getOutputType());
Class for single choice questions.
◆ $backupGlobals
assSingleChoiceTest::$backupGlobals = false |
|
protected |
The documentation for this class was generated from the following file: