ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
StandardNotificationRendererTestTBD.php
Go to the documentation of this file.
1<?php
2
19use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
21
22require_once(__DIR__ . "/../../BaseNotificationSetUp.php");
23
28{
29 use Hasher;
30
31
32 #[\Override]
33 protected function setUp(): void
34 {
35 parent::setUp();
36 if (!defined("ILIAS_HTTP_PATH")) {
37 define("ILIAS_HTTP_PATH", "http://localhost");
38 }
39 }
40
41 public function testConstruct(): void
42 {
44 $this->assertInstanceOf(StandardNotificationRenderer::class, $renderer);
45 }
46
47
49 {
51 $icon = $this->getUIFactory()->symbol()->icon()->standard("mail", "mail");
52 $item = $this->getUIFactory()->item()->notification("hello", $icon);
53
54 $standard_notification = $this->factory->standard($this->id)->withNotificationItem($item);
55
56 $this->assertEquals($item, $renderer->getNotificationComponentForItem($standard_notification));
57 }
58
59
61 {
63 $icon = $this->getUIFactory()->symbol()->icon()->standard("mail", "mail");
64 $item = $this->getUIFactory()->item()->notification("hello", $icon);
65
66 $standard_notification = $this->factory->standard($this->id)
67 ->withNotificationItem($item)
68 ->withClosedCallable(function (): void {
69 });
70
71 $item = $item->withCloseAction("notify.php?mode=closed&item_id=" . $this->hash($this->id->serialize()));
72 $this->assertEquals($item, $renderer->getNotificationComponentForItem($standard_notification));
73 }
74}
factory()
$renderer
Class BaseNotificationSetUp.