ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ 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\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(): C\Counter\Factory
40
{
41
return
new
I\Component\Counter\Factory();
42
}
43
public
function
legacy
(
string
$content): C\Legacy\Legacy
44
{
45
$f
=
new
I\Component\Legacy\Factory(
new
I
\
Component
\SignalGenerator());
46
return
$f
->legacy($content);
47
}
48
};
49
}
50
51
protected
function
getModalFactory
():
I
\
Component
\Modal\Factory
52
{
53
$group_mock = $this->createMock(Group::class);
54
$group_mock->method(
'withNameFrom'
)->willReturnSelf();
55
56
$factory_mock = $this->createMock(FieldFactory::class);
57
$factory_mock->method(
'group'
)->willReturn($group_mock);
58
59
return
new
I\Component\Modal\Factory(
60
new
SignalGeneratorMock
(),
61
$this->createMock(
C
\Modal\InterruptiveItem\Factory::class),
62
$factory_mock
63
);
64
}
65
66
protected
function
getButtonFactory
():
I
\
Component
\
Button
\Factory
67
{
68
return
new
I\Component\Button\Factory();
69
}
70
71
protected
function
getDummyComponent
():
DummyComponent
72
{
73
return
new
DummyComponent
();
74
}
75
76
public
function
normalizeHTML
(
string
$html): string
77
{
78
$html = parent::normalizeHTML($html);
79
// The times entity is used for closing the modal and not supported in DomDocument::loadXML()
80
return
str_replace([
'×'
,
"\t"
], [
''
,
''
], $html);
81
}
82
}
ILIAS\UI\Component\Input\Field\Factory
This is what a factory for input fields looks like.
Definition:
Factory.php:28
NoUIFactory
Definition:
Base.php:58
ModalBase\getButtonFactory
getButtonFactory()
Definition:
ModalBase.php:66
Standard
ILIAS\UI\Implementation
ILIAS\UI\Component
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ModalBase\getUIFactory
getUIFactory()
Definition:
ModalBase.php:36
ModalBase\getDummyComponent
getDummyComponent()
Definition:
ModalBase.php:71
DummyComponent
Definition:
Base.php:319
ModalBase
Base class for modal tests.
Definition:
ModalBase.php:34
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
ILIAS\UI\examples\MainControls\Slate\Legacy\legacy
legacy()
expected output: > ILIAS shows the rendered Component.
Definition:
legacy.php:13
ILIAS_UI_TestBase
ModalBase\normalizeHTML
normalizeHTML(string $html)
Definition:
ModalBase.php:76
ModalBase\getModalFactory
getModalFactory()
Definition:
ModalBase.php:51
SignalGeneratorMock
Definition:
Base.php:315
ILIAS\ILIASObject\Creation\Group
Definition:
AddNewItemElementTypes.php:26
components
ILIAS
UI
tests
Component
Modal
ModalBase.php
Generated on Wed Sep 10 2025 15:16:49 for ILIAS by
1.8.13 (using
Doxyfile
)