ILIAS
trunk Revision v11.0_alpha-1838-g59fc79e306b
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
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
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
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
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
ToastClientHtmlTest.php
Go to the documentation of this file.
1
<?php
2
19
require_once(
"vendor/composer/vendor/autoload.php"
);
20
21
require_once(__DIR__ .
"/../../Base.php"
);
22
23
use
ILIAS\UI\Component
as
C
;
24
use
ILIAS\UI\Implementation
as
I
;
25
26
class
ToastClientHtmlTest
extends
ILIAS_UI_TestBase
27
{
28
public
function
getUIFactory
():
NoUIFactory
29
{
30
return
new
class
() extends
NoUIFactory
{
31
public
function
button
(): I\Component\Button\Factory
32
{
33
return
new
I\Component\Button\Factory();
34
}
35
};
36
}
37
38
public
function
getToastFactory
(): \
ILIAS
\
UI
\
Implementation
\
Component
\Toast\Factory
39
{
40
return
new
ILIAS\UI\Implementation\Component\Toast\Factory
(
41
$this->createMock(
ILIAS
\
UI
\
Implementation
\
Component
\SignalGenerator::class)
42
);
43
}
44
45
public
function
getIconFactory
(): \
ILIAS
\
UI
\
Implementation
\
Component
\Symbol\
Icon
\Factory
46
{
47
return
new
ILIAS\UI\Implementation\Component\Symbol\Icon\Factory
();
48
}
49
50
public
function
testRenderClientHtml
(): void
51
{
52
$expected_html = file_get_contents(__DIR__ .
"/../../Client/Toast/ToastTest.html"
);
53
54
$rendered_html =
'<head>
55
<title>Toast Test HTML</title>
56
<script src="../../../resources/js/Toast/toast.js"></script>
57
<script>document.il = il</script>
58
</head>
59
<body>
60
{CONTAINER}
61
</body>'
;
62
63
$container
= $this->
getToastFactory
()->container()->withAdditionalToast(
64
$this->
getToastFactory
()->
standard
(
65
'Title'
,
66
$this->
getIconFactory
()->
standard
(
'mail'
,
'Test'
)
67
)
68
->withDescription(
'Description'
)
69
->
withAction
(
'https://www.ilias.de'
)
70
);
71
72
$rendered_html = str_replace(
'{CONTAINER}'
, $this->getDefaultRenderer()->render(
$container
), $rendered_html);
73
$rendered_html = preg_replace(
'/id=".*?"/'
,
''
, $rendered_html);
74
75
$this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($rendered_html));
76
}
77
}
NoUIFactory
Definition:
Base.php:58
ILIAS\Repository\button
button(string $caption, string $cmd)
Definition:
trait.GlobalDICGUIServices.php:187
ToastClientHtmlTest
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
ToastClientHtmlTest.php:26
ToastClientHtmlTest\getIconFactory
getIconFactory()
Definition:
ToastClientHtmlTest.php:45
ToastClientHtmlTest\getUIFactory
getUIFactory()
Definition:
ToastClientHtmlTest.php:28
ILIAS\UI\Implementation
Standard
ILIAS\UI\examples\MainControls\Slate\Notification\standard
standard()
description: > This is an example, of how the Notification Slate is generated by assigning Notificat...
Definition:
standard.php:38
ILIAS
Interface Observer Contains several chained tasks and infos about them.
Definition:
AccessControl.php:21
Factory
ILIAS\GlobalScreen\Scope\Footer\Factory\withAction
withAction(URI|Signal $action)
Definition:
hasActionTrait.php:35
ILIAS\UI\Component
ToastClientHtmlTest\getToastFactory
getToastFactory()
Definition:
ToastClientHtmlTest.php:38
$container
$container
Definition:
wac.php:36
ILIAS\UI\Implementation\Component\Table\Action
Definition:
Action.php:21
ILIAS\UI\Implementation\Component\Toast\Factory
Definition:
Factory.php:26
ILIAS_UI_TestBase
ToastClientHtmlTest\testRenderClientHtml
testRenderClientHtml()
Definition:
ToastClientHtmlTest.php:50
ILIAS\UI\Implementation\Component\Symbol\Icon\Factory
Definition:
Factory.php:25
components
ILIAS
UI
tests
Component
Toast
ToastClientHtmlTest.php
Generated on Wed Apr 16 2025 23:03:59 for ILIAS by
1.8.13 (using
Doxyfile
)