This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Unit tests
- Author
- Guido Vollbach <gvollbachdatabay.de>
Definition at line 25 of file assLongMenuTest.php.
◆ getMethod()
static assLongmenuTest::getMethod |
( |
|
$name | ) |
|
|
staticprotected |
◆ setUp()
assLongmenuTest::setUp |
( |
| ) |
|
|
protected |
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerDoesNotExistsInAnswers()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerDoesNotExistsInAnswers |
( |
| ) |
|
Definition at line 170 of file assLongMenuTest.php.
173 $obj->setCorrectAnswers(array( 0 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1')));
174 $obj->setAnswers(array(array(1)));
175 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerHasNoAnswers()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerHasNoAnswers |
( |
| ) |
|
Definition at line 178 of file assLongMenuTest.php.
181 $obj->setCorrectAnswers(array( 0 => array( 0 => array(),1 =>
'2.25', 2 =>
'1')));
182 $obj->setAnswers(array(array(
'answer')));
183 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerHasNoPoints()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerHasNoPoints |
( |
| ) |
|
Definition at line 186 of file assLongMenuTest.php.
189 $obj->setCorrectAnswers(array( 0 => array( 0 => array())));
190 $obj->setAnswers(array(array(
'answer')));
191 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerPointsAreZero()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseCorrectAnswerPointsAreZero |
( |
| ) |
|
Definition at line 194 of file assLongMenuTest.php.
197 $obj->setCorrectAnswers(array( 0 => array( 0 => array(
'answer'),1 => 0, 2 =>
'1')));
198 $obj->setAnswers(array(array(
'answer')));
199 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseNoCustomPart()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseNoCustomPart |
( |
| ) |
|
Definition at line 142 of file assLongMenuTest.php.
145 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseOnlyAnswers()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseOnlyAnswers |
( |
| ) |
|
Definition at line 148 of file assLongMenuTest.php.
151 $obj->setAnswers(array(array(1,2,3,4)));
152 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseOnlyCorrectAnswers()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseOnlyCorrectAnswers |
( |
| ) |
|
Definition at line 155 of file assLongMenuTest.php.
158 $obj->setCorrectAnswers(array( 0 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1'),
159 1 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1')));
160 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeFalseBecauseToManyCorrectAnswers()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeFalseBecauseToManyCorrectAnswers |
( |
| ) |
|
Definition at line 162 of file assLongMenuTest.php.
165 $obj->setCorrectAnswers(array( 0 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1'),
166 1 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1')));
167 $obj->setAnswers(array(array(
'answer')));
168 $this->assertEquals($obj->checkQuestionCustomPart(),
false);
◆ test_checkQuestionCustomPart_shouldBeTrue()
assLongmenuTest::test_checkQuestionCustomPart_shouldBeTrue |
( |
| ) |
|
Definition at line 202 of file assLongMenuTest.php.
205 $obj->setCorrectAnswers(array( 0 => array( 0 => array(
'answer'),1 => 1, 2 =>
'1')));
206 $obj->setAnswers(array(array(
'answer')));
207 $this->assertEquals($obj->checkQuestionCustomPart(),
true);
◆ test_correctAnswerDoesNotExistInAnswerOptions_shouldReturnFalse()
assLongmenuTest::test_correctAnswerDoesNotExistInAnswerOptions_shouldReturnFalse |
( |
| ) |
|
Definition at line 93 of file assLongMenuTest.php.
95 $method = self::getMethod(
'correctAnswerDoesNotExistInAnswerOptions');
97 $value = $method->invokeArgs($obj, array(array(array(1),1,1), array(1,2,3,4)));
98 $this->assertEquals(
false, $value);
◆ test_correctAnswerDoesNotExistInAnswerOptions_shouldReturnTrue()
assLongmenuTest::test_correctAnswerDoesNotExistInAnswerOptions_shouldReturnTrue |
( |
| ) |
|
Definition at line 85 of file assLongMenuTest.php.
87 $method = self::getMethod(
'correctAnswerDoesNotExistInAnswerOptions');
89 $value = $method->invokeArgs($obj, array(array(array(5),1,1), array(1,2,3,4)));
90 $this->assertEquals(
true, $value);
◆ test_getAdditionalTableName_shouldReturnString()
assLongmenuTest::test_getAdditionalTableName_shouldReturnString |
( |
| ) |
|
Definition at line 67 of file assLongMenuTest.php.
70 $this->assertEquals(
'qpl_qst_lome', $instance->getAdditionalTableName());
◆ test_getAnswerTableName_shouldReturnString()
assLongmenuTest::test_getAnswerTableName_shouldReturnString |
( |
| ) |
|
Definition at line 79 of file assLongMenuTest.php.
82 $this->assertEquals(
'qpl_a_lome', $instance->getAnswerTableName());
◆ test_getMaximumPoints_shouldBeFour()
assLongmenuTest::test_getMaximumPoints_shouldBeFour |
( |
| ) |
|
Definition at line 101 of file assLongMenuTest.php.
104 $obj->setCorrectAnswers(array( 0 => array( 0 => array(0 =>
'answer'),1 =>
'2', 2 =>
'1'),
105 1 => array( 0 => array(0 =>
'answer'),1 =>
'2', 2 =>
'1')));
106 $value = $obj->getMaximumPoints();
107 $this->assertEquals(4, $value);
◆ test_getMaximumPoints_shouldBeFourPointFive()
assLongmenuTest::test_getMaximumPoints_shouldBeFourPointFive |
( |
| ) |
|
Definition at line 110 of file assLongMenuTest.php.
113 $obj->setCorrectAnswers(array( 0 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1'),
114 1 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1')));
115 $value = $obj->getMaximumPoints();
116 $this->assertEquals(4.5, $value);
◆ test_getQuestionType_shouldReturnString()
assLongmenuTest::test_getQuestionType_shouldReturnString |
( |
| ) |
|
Definition at line 73 of file assLongMenuTest.php.
76 $this->assertEquals(
'assLongMenu', $instance->getQuestionType());
◆ test_getSolutionSubmit_shouldReturnSolution()
assLongmenuTest::test_getSolutionSubmit_shouldReturnSolution |
( |
| ) |
|
Definition at line 210 of file assLongMenuTest.php.
213 $array = array( 0 =>
'squirrel', 1 =>
'icebear');
214 $_POST[
'answer'] = $array;
215 $this->assertEquals($obj->getSolutionSubmit(), $array);
◆ test_instantiateObject_shouldReturnInstance()
assLongmenuTest::test_instantiateObject_shouldReturnInstance |
( |
| ) |
|
◆ test_isComplete_shouldBeFalse()
assLongmenuTest::test_isComplete_shouldBeFalse |
( |
| ) |
|
Definition at line 119 of file assLongMenuTest.php.
122 $obj->setCorrectAnswers(array( 0 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1'),
123 1 => array( 0 => array(0 =>
'answer'),1 =>
'2.25', 2 =>
'1')));
124 $obj->setAnswers(array(array(1,2,3,4)));
125 $this->assertEquals($obj->isComplete(),
false);
◆ test_isShuffleAnswersEnabled_shouldReturnFalse()
assLongmenuTest::test_isShuffleAnswersEnabled_shouldReturnFalse |
( |
| ) |
|
Definition at line 241 of file assLongMenuTest.php.
244 $this->assertEquals(
false, $obj->isShuffleAnswersEnabled());
245 $this->assertNotEquals(
true, $obj->isShuffleAnswersEnabled());
◆ test_setAnswerType_shouldReturnGetAnswerType()
assLongmenuTest::test_setAnswerType_shouldReturnGetAnswerType |
( |
| ) |
|
Definition at line 218 of file assLongMenuTest.php.
221 $obj->setAnswerType(0);
222 $this->assertEquals(0, $obj->getAnswerType());
◆ test_setJsonStructure_shouldReturnGetJsonStructure()
assLongmenuTest::test_setJsonStructure_shouldReturnGetJsonStructure |
( |
| ) |
|
Definition at line 234 of file assLongMenuTest.php.
237 $obj->setJsonStructure(json_encode(array(1 =>
'bla')));
238 $this->assertEquals(
'{"1":"bla"}', $obj->getJsonStructure());
◆ $backupGlobals
assLongmenuTest::$backupGlobals = false |
|
protected |
The documentation for this class was generated from the following file: