ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
ModalBase.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
require_once(__DIR__ .
"/../../../../../../vendor/composer/vendor/autoload.php"
);
22
require_once(__DIR__ .
"/../../Base.php"
);
23
24
use
ILIAS\UI\Component
as
C
;
25
use
ILIAS\UI\Implementation
as
I
;
26
use
ILIAS\UI\Implementation\Component\Input\Field\Factory
as
FieldFactory
;
27
use
ILIAS\UI\Implementation\Component\Input\Field\Group
;
28
34
abstract
class
ModalBase
extends
ILIAS_UI_TestBase
35
{
36
public
function
getUIFactory
():
NoUIFactory
37
{
38
return
new
class
() extends
NoUIFactory
{
39
public
function
counter(): I\Component\Counter\Factory
40
{
41
return
new
I\Component\Counter\Factory();
42
}
43
public
function
legacy
(): I\Component\Legacy\Factory
44
{
45
return
new
I\Component\Legacy\Factory(
new
I
\
Component
\SignalGenerator());
46
}
47
};
48
}
49
50
protected
function
getModalFactory
():
I
\
Component
\Modal\Factory
51
{
52
$group_mock = $this->createMock(Group::class);
53
$group_mock->method(
'withNameFrom'
)->willReturnSelf();
54
55
$factory_mock = $this->createMock(FieldFactory::class);
56
$factory_mock->method(
'group'
)->willReturn($group_mock);
57
58
return
new
I\Component\Modal\Factory(
59
new
SignalGeneratorMock
(),
60
$this->createMock(
I
\
Component
\Modal\InterruptiveItem\Factory::class),
61
$factory_mock
62
);
63
}
64
65
protected
function
getButtonFactory
():
I
\
Component
\
Button
\Factory
66
{
67
return
new
I\Component\Button\Factory();
68
}
69
70
protected
function
getDummyComponent
():
DummyComponent
71
{
72
return
new
DummyComponent
();
73
}
74
75
public
function
normalizeHTML
(
string
$html): string
76
{
77
$html = parent::normalizeHTML($html);
78
// The times entity is used for closing the modal and not supported in DomDocument::loadXML()
79
return
str_replace([
'×'
,
"\t"
], [
''
,
''
], $html);
80
}
81
}
NoUIFactory
Definition:
Base.php:58
ModalBase\getButtonFactory
getButtonFactory()
Definition:
ModalBase.php:65
Standard
ILIAS\UI\Implementation
Factory
ILIAS\UI\Component
ModalBase\getUIFactory
getUIFactory()
Definition:
ModalBase.php:36
ModalBase\getDummyComponent
getDummyComponent()
Definition:
ModalBase.php:70
DummyComponent
Definition:
Base.php:320
ModalBase
Base class for modal tests.
Definition:
ModalBase.php:34
ILIAS\UI\examples\MainControls\Slate\Legacy\legacy
legacy()
expected output: > ILIAS shows the rendered Component.
Definition:
legacy.php:29
ILIAS_UI_TestBase
ModalBase\normalizeHTML
normalizeHTML(string $html)
Definition:
ModalBase.php:75
ModalBase\getModalFactory
getModalFactory()
Definition:
ModalBase.php:50
Factory
SignalGeneratorMock
Definition:
Base.php:316
ILIAS\ILIASObject\Creation\Group
Definition:
AddNewItemElementTypes.php:26
components
ILIAS
UI
tests
Component
Modal
ModalBase.php
Generated on Sun Aug 31 2025 23:04:16 for ILIAS by
1.8.13 (using
Doxyfile
)