Unit tests for class ilLPStatusIcons.
More...
◆ getUIFactory()
ilLPStatusIconsTest::getUIFactory |
( |
| ) |
|
|
protected |
Definition at line 39 of file ilLPStatusIconsTest.php.
Referenced by testTripleton().
41 $custom_icon = $this->createMock(Custom::class);
42 $custom_icon->method(
'getIconPath')
43 ->willReturn($this->path);
44 $custom_icon->method(
'getSize')
45 ->willReturn($this->size);
46 $custom_icon->method(
'getLabel')
47 ->willReturn($this->alt);
49 $icon_factory = $this->createMock(IconFactory::class);
50 $icon_factory->method(
'custom')
51 ->willReturn($custom_icon);
53 $symbol_factory = $this->createMock(SymbolFactory::class);
54 $symbol_factory->method(
'icon')
55 ->willReturn($icon_factory);
57 $factory = $this->createMock(UIFactory::class);
58 $factory->method(
'symbol')
59 ->willReturn($symbol_factory);
◆ getUIRenderer()
ilLPStatusIconsTest::getUIRenderer |
( |
| ) |
|
|
protected |
Definition at line 64 of file ilLPStatusIconsTest.php.
References $renderer.
Referenced by testTripleton().
66 $renderer = $this->createMock(UIRenderer::class);
68 ->willReturnCallback(
function ($arg) {
69 return 'rendered: path(' . $arg->getIconPath() .
70 '), alt(' . $arg->getLabel() .
71 '), size(' . $arg->getSize() .
')';
◆ testGetInstanceForInvalidVariant()
ilLPStatusIconsTest::testGetInstanceForInvalidVariant |
( |
| ) |
|
Definition at line 105 of file ilLPStatusIconsTest.php.
References $renderer, and ilLPStatusIcons\getInstance().
107 $renderer = $this->getMockBuilder(UIRenderer::class)
108 ->disableOriginalConstructor()
111 $factory = $this->getMockBuilder(UIFactory::class)
112 ->disableOriginalConstructor()
115 $this->expectException(ilLPException::class);
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
◆ testImagePathAssetForLongVariant()
ilLPStatusIconsTest::testImagePathAssetForLongVariant |
( |
array |
$instances | ) |
|
- Parameters
-
array<string,ilLPStatusIcons> | $instances |
Definition at line 152 of file ilLPStatusIconsTest.php.
154 $this->expectException(ilLPException::class);
155 $instances[
'long']->getImagePathAsset();
◆ testImagePathRunningForLongVariant()
ilLPStatusIconsTest::testImagePathRunningForLongVariant |
( |
array |
$instances | ) |
|
- Parameters
-
array<string,ilLPStatusIcons> | $instances |
Definition at line 142 of file ilLPStatusIconsTest.php.
144 $this->expectException(ilLPException::class);
145 $instances[
'long']->getImagePathRunning();
◆ testRenderScormIcons()
ilLPStatusIconsTest::testRenderScormIcons |
( |
array |
$instances | ) |
|
- Parameters
-
array<string,ilLPStatusIcons> | $instances |
Definition at line 184 of file ilLPStatusIconsTest.php.
186 $this->expectException(ilLPException::class);
187 $instances[
'scorm']->renderIcon(
'path',
'alt');
◆ testSomeExamplesForImagePathsByStatus()
ilLPStatusIconsTest::testSomeExamplesForImagePathsByStatus |
( |
array |
$instances | ) |
|
◆ testSomeExamplesForRenderedIcons()
ilLPStatusIconsTest::testSomeExamplesForRenderedIcons |
( |
array |
$instances | ) |
|
- Parameters
-
array<string,ilLPStatusIcons> | $instances |
Definition at line 162 of file ilLPStatusIconsTest.php.
166 'rendered: path(' . $this->path .
167 '), alt(' . $this->alt .
168 '), size(' . $this->size .
')',
169 $instances[
'long']->renderIcon($this->path, $this->alt)
173 'rendered: path(' . $this->path .
174 '), alt(' . $this->alt .
175 '), size(' . $this->size .
')',
176 $instances[
'short']->renderIcon($this->path, $this->alt)
◆ testTripleton()
ilLPStatusIconsTest::testTripleton |
( |
| ) |
|
- Returns
- array<string, ilLPStatusIcons>
Definition at line 80 of file ilLPStatusIconsTest.php.
References $renderer, ilLPStatusIcons\getInstance(), getUIFactory(), getUIRenderer(), ilLPStatusIcons\ICON_VARIANT_LONG, ilLPStatusIcons\ICON_VARIANT_SCORM, and ilLPStatusIcons\ICON_VARIANT_SHORT.
94 $this->assertSame($short1, $short2);
95 $this->assertSame($long1, $long2);
96 $this->assertSame($scorm1, $scorm2);
98 $this->assertNotSame($long1, $short1);
99 $this->assertNotSame($long1, $scorm1);
100 $this->assertNotSame($short1, $scorm1);
102 return [
'long' => $long1,
'short' => $short1,
'scorm' => $scorm1];
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
◆ $alt
ilLPStatusIconsTest::$alt = 'alt' |
|
protected |
◆ $path
ilLPStatusIconsTest::$path = 'sample/path' |
|
protected |
◆ $size
ilLPStatusIconsTest::$size = Icon::SMALL |
|
protected |
The documentation for this class was generated from the following file: