ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
ToastClientHtmlTest.php
Go to the documentation of this file.
1
<?php
18
require_once(
"libs/composer/vendor/autoload.php"
);
19
20
require_once(__DIR__ .
"/../../Base.php"
);
21
22
use
ILIAS\UI\Component
as
C
;
23
use
ILIAS\UI\Implementation
as
I
;
24
25
class
ToastClientHtmlTest
extends
ILIAS_UI_TestBase
26
{
27
public
function
getUIFactory
():
NoUIFactory
28
{
29
return
new
class
() extends
NoUIFactory
{
30
public
function
button(): C\Button\Factory
31
{
32
return
new
I\Component\Button\Factory();
33
}
34
};
35
}
36
37
public
function
getToastFactory
(): \
ILIAS
\
UI
\
Implementation
\
Component
\Toast\
Factory
38
{
39
return
new
ILIAS\UI\Implementation\Component\Toast\Factory
(
40
$this->createMock(
ILIAS
\
UI
\
Implementation
\
Component
\SignalGenerator::class)
41
);
42
}
43
44
public
function
getIconFactory
(): \
ILIAS
\
UI
\
Implementation
\
Component
\Symbol\Icon\
Factory
45
{
46
return
new
ILIAS\UI\Implementation\Component\Symbol\Icon\Factory
();
47
}
48
49
public
function
testRenderClientHtml
(): void
50
{
51
$expected_html = file_get_contents(__DIR__ .
"/../../Client/Toast/ToastTest.html"
);
52
53
$rendered_html =
'<head>
54
<title>Toast Test HTML</title>
55
<script src="../../../../src/UI/templates/js/Toast/toast.js"></script>
56
<script>document.il = il</script>
57
</head>
58
<body>
59
{CONTAINER}
60
</body>'
;
61
62
$container
= $this->
getToastFactory
()->container()->withAdditionalToast(
63
$this->
getToastFactory
()->
standard
(
64
'Title'
,
65
$this->
getIconFactory
()->
standard
(
'mail'
,
'Test'
)
66
)
67
->withVanishTime(5000)
68
->withDelayTime(500)
69
->withDescription(
'Description'
)
70
->withAction(
'https://www.ilias.de'
)
71
);
72
73
$rendered_html = str_replace(
'{CONTAINER}'
, $this->
getDefaultRenderer
()->render(
$container
), $rendered_html);
74
$rendered_html = preg_replace(
'/id=".*?"/'
,
''
, $rendered_html);
75
76
$this->assertEquals($this->
brutallyTrimHTML
($expected_html), $this->
brutallyTrimHTML
($rendered_html));
77
}
78
}
NoUIFactory
Definition:
Base.php:53
ILIAS_UI_TestBase\getDefaultRenderer
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition:
Base.php:355
ToastClientHtmlTest
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
ToastClientHtmlTest.php:25
UI
Class Factory.
ToastClientHtmlTest\getIconFactory
getIconFactory()
Definition:
ToastClientHtmlTest.php:44
ToastClientHtmlTest\getUIFactory
getUIFactory()
Definition:
ToastClientHtmlTest.php:27
ILIAS\UI\Implementation
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\UI\examples\MainControls\Slate\Notification\standard
standard()
This is an example, of how the Notification Slate is generated by assigning Notification Items to it...
Definition:
standard.php:16
ILIAS
Class ChatMainBarProvider .
ILIAS\UI\Component
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ToastClientHtmlTest\getToastFactory
getToastFactory()
Definition:
ToastClientHtmlTest.php:37
ILIAS_UI_TestBase\brutallyTrimHTML
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition:
Base.php:444
$container
$container
Definition:
wac.php:14
Factory
ILIAS_UI_TestBase
Provides common functionality for UI tests.
Definition:
Base.php:298
ILIAS\UI\Factory
This is how the factory for UI elements looks.
Definition:
Factory.php:37
ILIAS\UI\Implementation\Component\Table\Action
Definition:
Action.php:21
ILIAS\UI\Implementation\Component\Toast\Factory
Definition:
Factory.php:26
ToastClientHtmlTest\testRenderClientHtml
testRenderClientHtml()
Definition:
ToastClientHtmlTest.php:49
tests
UI
Component
Toast
ToastClientHtmlTest.php
Generated on Tue Apr 1 2025 22:02:54 for ILIAS by
1.8.13 (using
Doxyfile
)