ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
ItemNotificationClientHtmlTest.php
Go to the documentation of this file.
1
<?php
2
19
require_once(__DIR__ .
"/../../../../../../vendor/composer/vendor/autoload.php"
);
20
require_once(__DIR__ .
"/../../Base.php"
);
21
22
use
ILIAS\UI\Component
as
C
;
23
use
ILIAS\UI\Implementation\Component
as
I
;
24
use
ILIAS\UI\Implementation\Component\MainControls\Slate\Notification
;
25
29
class
ItemNotificationClientHtmlTest
extends
ILIAS_UI_TestBase
30
{
34
protected
$sig_gen
;
35
36
protected
C\MainControls\MetaBar
$metabar
;
37
38
public
function
setUp
(): void
39
{
40
$this->sig_gen =
new
I\SignalGenerator();
41
}
42
43
public
function
getUIFactory
():
NoUIFactory
44
{
45
$factory =
new
class
() extends
NoUIFactory
{
46
public
I\SignalGenerator
$sig_gen
;
47
48
public
function
counter(): I\Counter\Factory
49
{
50
return
new
I\Counter\Factory();
51
}
52
public
function
button
(): I\Button\Factory
53
{
54
return
new
I\Button\Factory();
55
}
56
public
function
symbol
(): I\Symbol\Factory
57
{
58
return
new
I\Symbol\Factory(
59
new
I
\Symbol\
Icon
\Factory(),
60
new
I
\Symbol\Glyph\Factory(),
61
new
I
\Symbol\Avatar\Factory()
62
);
63
}
64
public
function
item(): I\Item\Factory
65
{
66
return
new
I\Item\Factory();
67
}
68
public
function
mainControls(): I\MainControls\Factory
69
{
70
return
new
I\MainControls\Factory(
71
$this->sig_gen,
72
new
I
\MainControls\Slate\Factory(
73
$this->sig_gen,
74
new
\
ILIAS
\
UI
\
Implementation
\
Component
\Counter\Factory(),
75
$this->
symbol
()
76
)
77
);
78
}
79
};
80
$factory->sig_gen =
$this->sig_gen
;
81
82
return
$factory;
83
}
84
85
public
function
testRenderClientHtml
(): void
86
{
87
$f
= $this->
getUIFactory
();
88
$expected_html = file_get_contents(__DIR__ .
"/../../Client/Item/Notification/NotificationItemTest.html"
);
89
90
$icon =
$f
->symbol()->icon()->standard(
"name"
,
"aria_label"
,
"small"
,
false
);
91
92
$item =
$f
->item()->notification(
"item title"
, $icon)
93
->withCloseAction(
"close_action"
);
94
95
$item2 = $item->withDescription(
"Existing Description"
)
96
->withProperties([
"Label 1"
=>
"Property Value 1"
,
"Label 2"
=>
"Property Value 2"
])
97
->withAggregateNotifications([$item]);
98
$notification_slate =
$f
->mainControls()->slate()->notification(
99
"slate title"
,
100
[$item,$item2]
101
);
102
103
$glyph =
$f
->symbol()->glyph()->notification()->withCounter($this->
getUIFactory
()->counter()->novelty(2));
104
$notification_center =
$f
->mainControls()->slate()->combined(
"notification center"
, $glyph)
105
->withAdditionalEntry($notification_slate);
106
107
$this->metabar =
$f
->mainControls()->metaBar()->withAdditionalEntry(
"Test Slate"
, $notification_center);
108
$rendered_html = $this->getDefaultRenderer()->render($this->metabar);
109
110
$this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($rendered_html));
111
}
112
}
NoUIFactory
Definition:
Base.php:58
ItemNotificationClientHtmlTest
Checks if the HTML used for the Client tests is rendered as specified.
Definition:
ItemNotificationClientHtmlTest.php:29
ILIAS\Repository\button
button(string $caption, string $cmd)
Definition:
trait.GlobalDICGUIServices.php:194
ILIAS\UI\Implementation\Component
ILIAS\UI\Implementation
Standard
ILIAS
Interface Observer Contains several chained tasks and infos about them.
Definition:
AccessControl.php:21
Factory
ILIAS\UI\Component
ItemNotificationClientHtmlTest\setUp
setUp()
Definition:
ItemNotificationClientHtmlTest.php:38
ItemNotificationClientHtmlTest\testRenderClientHtml
testRenderClientHtml()
Definition:
ItemNotificationClientHtmlTest.php:85
ILIAS\UI\Implementation\Component\Table\Action
Definition:
Action.php:21
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
Notification
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS_UI_TestBase
ItemNotificationClientHtmlTest\$sig_gen
$sig_gen
Definition:
ItemNotificationClientHtmlTest.php:34
ILIAS\Repository\symbol
symbol()
Definition:
trait.GlobalDICGUIServices.php:216
ItemNotificationClientHtmlTest\$metabar
C MainControls MetaBar $metabar
Definition:
ItemNotificationClientHtmlTest.php:36
ItemNotificationClientHtmlTest\getUIFactory
getUIFactory()
Definition:
ItemNotificationClientHtmlTest.php:43
components
ILIAS
UI
tests
Component
Item
ItemNotificationClientHtmlTest.php
Generated on Sun Aug 31 2025 23:04:16 for ILIAS by
1.8.13 (using
Doxyfile
)