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.
References defined.
19 require_once
'./Modules/TestQuestionPool/classes/class.assSingleChoice.php';
20 if (
defined(
'ILIAS_PHPUNIT_CONTEXT'))
22 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
23 ilUnitUtil::performInitialisation();
27 chdir( dirname( __FILE__ ) );
30 require_once
'./Services/Utilities/classes/class.ilUtil.php';
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
◆ test_flushAnswers_shouldClearAnswers()
assSingleChoiceTest::test_flushAnswers_shouldClearAnswers |
( |
| ) |
|
Definition at line 124 of file assSingleChoiceTest.php.
127 $obj->addAnswer(
'1', 1, 0);
128 $obj->addAnswer(
'1', 1, 1);
129 $this->assertEquals(2, $obj->getAnswerCount());
130 $obj->flushAnswers();
131 $this->assertEquals(0, $obj->getAnswerCount());
Class for single choice questions.
◆ test_getAdditionalTableName_shouldReturnAdditionalTableName()
assSingleChoiceTest::test_getAdditionalTableName_shouldReturnAdditionalTableName |
( |
| ) |
|
Definition at line 140 of file assSingleChoiceTest.php.
143 $this->assertEquals(
'qpl_qst_sc', $obj->getAdditionalTableName());
Class for single choice questions.
◆ test_getAnswerCount_shouldReturnCount()
assSingleChoiceTest::test_getAnswerCount_shouldReturnCount |
( |
| ) |
|
Definition at line 113 of file assSingleChoiceTest.php.
116 $this->assertEquals(0, $obj->getAnswerCount());
117 $obj->addAnswer(
'1', 1, 0);
118 $obj->addAnswer(
'1', 1, 1);
119 $this->assertEquals(2, $obj->getAnswerCount());
120 $obj->deleteAnswer(0);
121 $this->assertEquals(1, $obj->getAnswerCount());
Class for single choice questions.
◆ test_getAnswerTableName_shouldReturnAnswerTableName()
assSingleChoiceTest::test_getAnswerTableName_shouldReturnAnswerTableName |
( |
| ) |
|
Definition at line 146 of file assSingleChoiceTest.php.
149 $this->assertEquals(
'qpl_a_sc', $obj->getAnswerTableName());
Class for single choice questions.
◆ test_getQuestionType_shouldReturnQuestionType()
assSingleChoiceTest::test_getQuestionType_shouldReturnQuestionType |
( |
| ) |
|
Definition at line 134 of file assSingleChoiceTest.php.
137 $this->assertEquals(
'assSingleChoice', $obj->getQuestionType());
Class for single choice questions.
◆ test_getThumbPrefix_shouldReturnString()
assSingleChoiceTest::test_getThumbPrefix_shouldReturnString |
( |
| ) |
|
Definition at line 100 of file assSingleChoiceTest.php.
103 $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 88 of file assSingleChoiceTest.php.
91 $this->assertEquals(
false, $obj->isComplete());
92 $obj->setTitle(
'Tilte');
93 $obj->setAuthor(
'Me or another');
94 $obj->setQuestion(
'My great Question.');
95 $obj->addAnswer(
'Super simple single Choice', 1);
97 $this->assertEquals(
true, $obj->isComplete());
Class for single choice questions.
◆ test_setOutputType_shouldReturngetOutputType()
assSingleChoiceTest::test_setOutputType_shouldReturngetOutputType |
( |
| ) |
|
Definition at line 106 of file assSingleChoiceTest.php.
109 $obj->setOutputType(0);
110 $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: