ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
StandardNotificationRendererTestTBD.php
Go to the documentation of this file.
1
<?php
2
19
use
ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher
;
20
use
ILIAS\GlobalScreen\Scope\Notification\Collector\Renderer\StandardNotificationRenderer
;
21
22
require_once(__DIR__ .
"/../../BaseNotificationSetUp.php"
);
23
27
class
StandardNotificationRendererTest
extends
BaseNotificationSetUp
28
{
29
use
Hasher
;
30
31
32
protected
function
setUp
(): void
33
{
34
parent::setUp();
35
if
(!defined(
"ILIAS_HTTP_PATH"
)) {
36
define(
"ILIAS_HTTP_PATH"
,
"http://localhost"
);
37
}
38
}
39
40
public
function
testConstruct
(): void
41
{
42
$renderer
=
new
StandardNotificationRenderer
($this->
getUIFactory
());
43
$this->assertInstanceOf(StandardNotificationRenderer::class,
$renderer
);
44
}
45
46
47
public
function
testGetNotificationComponentForItem
(): void
48
{
49
$renderer
=
new
StandardNotificationRenderer
($this->
getUIFactory
());
50
$icon = $this->
getUIFactory
()->symbol()->icon()->standard(
"mail"
,
"mail"
);
51
$item = $this->
getUIFactory
()->item()->notification(
"hello"
, $icon);
52
53
$standard_notification = $this->factory->standard($this->
id
)->withNotificationItem($item);
54
55
$this->assertEquals($item,
$renderer
->getNotificationComponentForItem($standard_notification));
56
}
57
58
59
public
function
testGetNotificationComponentForItemWithCloseCallable
(): void
60
{
61
$renderer
=
new
StandardNotificationRenderer
($this->
getUIFactory
());
62
$icon = $this->
getUIFactory
()->symbol()->icon()->standard(
"mail"
,
"mail"
);
63
$item = $this->
getUIFactory
()->item()->notification(
"hello"
, $icon);
64
65
$standard_notification = $this->factory->standard($this->
id
)
66
->withNotificationItem($item)
67
->withClosedCallable(
function
():
void
{
68
});
69
70
$item = $item->withCloseAction(
"notify.php?mode=closed&item_id="
. $this->
hash
($this->
id
->serialize()));
71
$this->assertEquals($item,
$renderer
->getNotificationComponentForItem($standard_notification));
72
}
73
}
BaseNotificationSetUp\getUIFactory
getUIFactory()
Definition:
BaseNotificationSetUpTBD.php:80
StandardNotificationRendererTest\setUp
setUp()
Definition:
StandardNotificationRendererTestTBD.php:32
$renderer
$renderer
Definition:
build_bootstrap.php:83
StandardNotificationRendererTest\testConstruct
testConstruct()
Definition:
StandardNotificationRendererTestTBD.php:40
BaseNotificationSetUp
Class BaseNotificationSetUp.
Definition:
BaseNotificationSetUpTBD.php:42
StandardNotificationRenderer
StandardNotificationRendererTest
Class StandardNotificationTest.
Definition:
StandardNotificationRendererTestTBD.php:27
Hasher
hash
StandardNotificationRendererTest\testGetNotificationComponentForItemWithCloseCallable
testGetNotificationComponentForItemWithCloseCallable()
Definition:
StandardNotificationRendererTestTBD.php:59
ILIAS\GlobalScreen\Scope\Notification\Collector\Renderer\StandardNotificationRenderer
Class StandardNotificationGroupRenderer.
Definition:
StandardNotificationRenderer.php:32
Hasher
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\GlobalScreen\Provider\id
id()
Definition:
PluginProviderHelper.php:54
StandardNotificationRendererTest\testGetNotificationComponentForItem
testGetNotificationComponentForItem()
Definition:
StandardNotificationRendererTestTBD.php:47
components
ILIAS
GlobalScreen
tests
Notification
Collector
Renderer
StandardNotificationRendererTestTBD.php
Generated on Wed Sep 10 2025 15:15:42 for ILIAS by
1.8.13 (using
Doxyfile
)