Unit tests.
More...
◆ setUp()
assClozeSelectGapTest::setUp |
( |
| ) |
|
|
protected |
◆ test_arrayShuffle_shouldShuffleArray()
assClozeSelectGapTest::test_arrayShuffle_shouldShuffleArray |
( |
| ) |
|
Definition at line 55 of file assClozeSelectGapTest.php.
58 $expected = [
'shfksdfs',
'sfsdf',
'sdfsdfdf'];
60 $transformationMock = $this->getMockBuilder(Transformation::class)->getMock();
61 $transformationMock->expects(self::once())->method(
'transform')->willReturn($expected);
62 $actual = $instance->getItems($transformationMock);
63 $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 102 of file assClozeSelectGapTest.php.
110 $instance->addItem($item1);
111 $instance->addItem($item2);
112 $instance->addItem($item3);
113 $instance->addItem($item4);
115 $instance->setType(
false);
117 $expected = [$item1, $item2, $item3, $item4];
118 $transformationMock = $this->getMockBuilder(Transformation::class)->getMock();
119 $transformationMock->expects(self::once())->method(
'transform')->willReturnCallback(
function ($value) {
122 $actual = $instance->getItems($transformationMock);
124 $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 66 of file assClozeSelectGapTest.php.
78 $instance->addItem($item1);
79 $instance->addItem($item2);
80 $instance->addItem($item3);
81 $instance->addItem($item4);
82 $instance->addItem($item5);
83 $instance->addItem($item6);
84 $instance->addItem($item7);
85 $instance->addItem($item8);
87 $instance->setType(
true);
89 $sequence = [$item1, $item3, $item2, $item4, $item5, $item6, $item7, $item8];
90 $expectedSequence = array_reverse($sequence);
92 $randomElmProvider = $this->getMockBuilder(Transformation::class)->getMock();
93 $randomElmProvider->expects($this->once())
96 ->willReturn($expectedSequence);
98 $actual = $instance->getItems($randomElmProvider);
99 $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.
42 $this->assertInstanceOf(assClozeSelectGap::class, $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 45 of file assClozeSelectGapTest.php.
50 $actual = $instance->getShuffle();
52 $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: