ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
UITestHelper.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\DI\Container
;
25
use
ILIAS\UI\Factory
;
26
use
ILIAS\UI\Renderer
;
27
use
ILIAS\Refinery\Factory
as RefinaryFactory;
28
use
ILIAS\Data\Factory
as DataFactory;
29
35
trait
UITestHelper
36
{
37
protected
Container
$dic_with_ui;
38
39
public
function
init
(?
Container
$dic
=
null
):
Container
40
{
41
if
(
$dic
) {
42
$this->dic_with_ui =
$dic
;
43
}
else
{
44
$this->dic_with_ui =
new
Container
();
45
}
46
47
$tpl_fac =
new
ilIndependentTemplateFactory
();
48
$this->dic_with_ui[
"tpl"
] = $tpl_fac->getTemplate(
"tpl.main.html"
,
false
,
false
);
49
$this->dic_with_ui[
"lng"
] =
new
LanguageMock
();
50
$data_factory =
new
DataFactory();
51
$this->dic_with_ui[
"refinery"
] =
new
RefinaryFactory($data_factory, $this->dic_with_ui[
"lng"
]);
52
53
(
new
InitUIFramework
())->
init
($this->dic_with_ui);
54
55
$this->dic_with_ui[
"ui.template_factory"
] =
new
ilIndependentTemplateFactory
();
56
$this->dic_with_ui[
"help.text_retriever"
] =
new
ILIAS\UI\Help\TextRetriever\Echoing
();
57
58
return
$this->dic_with_ui;
59
}
60
61
public
function
factory
():
Factory
62
{
63
if
(!isset($this->dic_with_ui)) {
64
$this->
init
();
65
}
66
return
$this->dic_with_ui->ui()->factory();
67
}
68
69
public
function
renderer
():
Renderer
70
{
71
if
(!isset($this->dic_with_ui)) {
72
$this->
init
();
73
}
74
return
$this->dic_with_ui->ui()->renderer();
75
}
76
77
public
function
mainTemplate
():
ilGlobalTemplateInterface
78
{
79
if
(!isset($this->dic_with_ui)) {
80
$this->
init
();
81
}
82
return
$this->dic_with_ui->ui()->mainTemplate();
83
}
84
}
mainTemplate
mainTemplate()
Definition:
UITestHelper.php:77
UITestHelper
trait UITestHelper
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
Definition:
UITestHelper.php:36
renderer
renderer()
Definition:
UITestHelper.php:69
factory
factory()
Definition:
UITestHelper.php:61
init
init(?Container $dic=null)
Definition:
UITestHelper.php:39
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:36
ILIAS\Data\Color\Factory
Builds a Color from either hex- or rgb values.
Definition:
Factory.php:31
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:36
ILIAS\UI\Help\TextRetriever\Echoing
This HelpTextRetriever simply echo the purpose and the topics for debugging and development purpose.
Definition:
Echoing.php:31
InitUIFramework
This is more or less a copy of the removed InitUIFramework file inside the Init component.
Definition:
InitUIFramework.php:30
LanguageMock
Definition:
Base.php:175
ilIndependentTemplateFactory
Definition:
Base.php:51
ILIAS\UI\Factory
This is how the factory for UI elements looks.
Definition:
Factory.php:38
ILIAS\UI\Renderer
An entity that renders components to a string output.
Definition:
Renderer.php:31
ilGlobalTemplateInterface
Definition:
interface.ilGlobalTemplateInterface.php:27
$dic
$dic
Definition:
ltiresult.php:33
components
ILIAS
UI
tests
UITestHelper.php
Generated on Sat Oct 18 2025 23:04:57 for ILIAS by
1.9.4 (using
Doxyfile
)