ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
StandardNotificationRendererTest.php
Go to the documentation of this file.
1<?php
2
3use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
5
6require_once(__DIR__ . "/../../BaseNotificationSetUp.php");
7const ILIAS_HTTP_PATH = "some_path";
8
13{
14 use Hasher;
15
16
17 public function testConstruct()
18 {
19 $renderer = new StandardNotificationRenderer($this->getUIFactory());
20 $this->assertInstanceOf(StandardNotificationRenderer::class, $renderer);
21 }
22
23
25 {
26 $renderer = new StandardNotificationRenderer($this->getUIFactory());
27 $icon = $this->getUIFactory()->symbol()->icon()->standard("mail", "mail");
28 $item = $this->getUIFactory()->item()->notification("hello", $icon);
29
30 $standard_notification = $this->factory->standard($this->id)->withNotificationItem($item);
31
32 $this->assertEquals($item, $renderer->getNotificationComponentForItem($standard_notification));
33 }
34
35
37 {
38 $renderer = new StandardNotificationRenderer($this->getUIFactory());
39 $icon = $this->getUIFactory()->symbol()->icon()->standard("mail", "mail");
40 $item = $this->getUIFactory()->item()->notification("hello", $icon);
41
42 $standard_notification = $this->factory->standard($this->id)
43 ->withNotificationItem($item)
44 ->withClosedCallable(function () {
45 });
46
47 $item = $item->withCloseAction("some_path/src/GlobalScreen/Client/notify.php?mode=closed&item_id=" . $this->hash($this->id->serialize()));
48 $this->assertEquals($item, $renderer->getNotificationComponentForItem($standard_notification));
49 }
50}
Class BaseNotificationSetUp.
An exception for terminatinating execution or to throw for unit testing.