ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ItemNotificationClientHtmlTest Class Reference

Checks if the HTML used for the Client tests is rendered as specified. More...

+ Inheritance diagram for ItemNotificationClientHtmlTest:
+ Collaboration diagram for ItemNotificationClientHtmlTest:

Public Member Functions

 setUp ()
 
 getUIFactory ()
 
 testRenderClientHtml ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getHelpTextRetriever ()
 
 getUploadLimitResolver ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Protected Attributes

 $sig_gen
 
C MainControls MetaBar $metabar
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

Checks if the HTML used for the Client tests is rendered as specified.

Definition at line 29 of file ItemNotificationClientHtmlTest.php.

Member Function Documentation

◆ getUIFactory()

ItemNotificationClientHtmlTest::getUIFactory ( )

Definition at line 43 of file ItemNotificationClientHtmlTest.php.

References $sig_gen, ILIAS\Repository\button(), and ILIAS\Repository\symbol().

Referenced by testRenderClientHtml().

43  : NoUIFactory
44  {
45  $factory = new class () extends NoUIFactory {
47 
48  public function counter(): C\Counter\Factory
49  {
50  return new I\Counter\Factory();
51  }
52  public function button(): C\Button\Factory
53  {
54  return new I\Button\Factory($this->sig_gen);
55  }
56  public function symbol(): ILIAS\UI\Component\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(): C\Item\Factory
65  {
66  return new I\Item\Factory();
67  }
68  public function mainControls(): C\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  }
button(string $caption, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

ItemNotificationClientHtmlTest::setUp ( )

Definition at line 38 of file ItemNotificationClientHtmlTest.php.

38  : void
39  {
40  $this->sig_gen = new I\SignalGenerator();
41  }

◆ testRenderClientHtml()

ItemNotificationClientHtmlTest::testRenderClientHtml ( )

Definition at line 85 of file ItemNotificationClientHtmlTest.php.

References Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().

85  : 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  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:475
+ Here is the call graph for this function:

Field Documentation

◆ $metabar

C MainControls MetaBar ItemNotificationClientHtmlTest::$metabar
protected

Definition at line 36 of file ItemNotificationClientHtmlTest.php.

◆ $sig_gen

ItemNotificationClientHtmlTest::$sig_gen
protected

Definition at line 34 of file ItemNotificationClientHtmlTest.php.

Referenced by getUIFactory().


The documentation for this class was generated from the following file: