Unit tests.
More...
◆ setUp()
assClozeSelectGapTest::setUp |
( |
| ) |
|
|
protected |
◆ test_arrayShuffle_shouldShuffleArray()
assClozeSelectGapTest::test_arrayShuffle_shouldShuffleArray |
( |
| ) |
|
Definition at line 61 of file assClozeSelectGapTest.php.
64 require_once
'./Modules/TestQuestionPool/classes/class.assClozeSelectGap.php';
66 $expected = [
'shfksdfs',
'sfsdf',
'sdfsdfdf'];
68 $transformationMock = $this->getMockBuilder(Transformation::class)->getMock();
69 $transformationMock->expects(self::once())->method(
'transform')->willReturn($expected);
70 $actual = $instance->getItems($transformationMock);
71 $this->assertEquals($expected, $actual);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_getItemswithoutShuffle_shouldReturnItemsInOrder()
assClozeSelectGapTest::test_getItemswithoutShuffle_shouldReturnItemsInOrder |
( |
| ) |
|
Definition at line 113 of file assClozeSelectGapTest.php.
115 require_once
'./Modules/TestQuestionPool/classes/class.assClozeSelectGap.php';
118 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
124 $instance->addItem($item1);
125 $instance->addItem($item2);
126 $instance->addItem($item3);
127 $instance->addItem($item4);
129 $instance->setType(
false);
131 $expected = array($item1, $item2, $item3, $item4);
132 $transformationMock = $this->getMockBuilder(Transformation::class)->getMock();
133 $transformationMock->expects(self::once())->method(
'transform')->willReturnCallback(
function ($value) {
136 $actual = $instance->getItems($transformationMock);
138 $this->assertEquals($expected, $actual);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_getItemswithShuffle_shouldReturnShuffledItems()
assClozeSelectGapTest::test_getItemswithShuffle_shouldReturnShuffledItems |
( |
| ) |
|
Definition at line 74 of file assClozeSelectGapTest.php.
76 require_once
'./Modules/TestQuestionPool/classes/class.assClozeSelectGap.php';
79 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerCloze.php';
89 $instance->addItem($item1);
90 $instance->addItem($item2);
91 $instance->addItem($item3);
92 $instance->addItem($item4);
93 $instance->addItem($item5);
94 $instance->addItem($item6);
95 $instance->addItem($item7);
96 $instance->addItem($item8);
98 $instance->setType(
true);
100 $sequence = [$item1, $item3, $item2, $item4, $item5, $item6, $item7, $item8];
101 $expectedSequence = array_reverse($sequence);
103 $randomElmProvider = $this->getMockBuilder(Transformation::class)->getMock();
104 $randomElmProvider->expects($this->once())
105 ->method(
'transform')
107 ->willReturn($expectedSequence);
109 $actual = $instance->getItems($randomElmProvider);
110 $this->assertEquals($actual, $expectedSequence);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_instantiateObject_shouldReturnInstance()
assClozeSelectGapTest::test_instantiateObject_shouldReturnInstance |
( |
| ) |
|
Definition at line 38 of file assClozeSelectGapTest.php.
41 require_once
'./Modules/TestQuestionPool/classes/class.assClozeSelectGap.php';
46 $this->assertInstanceOf(
'assClozeSelectGap', $instance);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ test_newlyInstatiatedObject_shouldReturnTrueOnGetShuffle()
assClozeSelectGapTest::test_newlyInstatiatedObject_shouldReturnTrueOnGetShuffle |
( |
| ) |
|
Definition at line 49 of file assClozeSelectGapTest.php.
52 require_once
'./Modules/TestQuestionPool/classes/class.assClozeSelectGap.php';
56 $actual = $instance->getShuffle();
58 $this->assertEquals($expected, $actual);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ $backupGlobals
assClozeSelectGapTest::$backupGlobals = false |
|
protected |
The documentation for this class was generated from the following file: