ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
StandardNotificationRendererTestTBD.php
Go to the documentation of this file.
1 <?php
2 
21 
22 require_once(__DIR__ . "/../../BaseNotificationSetUp.php");
23 
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  {
43  $this->assertInstanceOf(StandardNotificationRenderer::class, $renderer);
44  }
45 
46 
47  public function testGetNotificationComponentForItem(): void
48  {
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 
60  {
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 }
$renderer
Class BaseNotificationSetUp.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...