ILIAS  release_8 Revision v8.24
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 ()
 
 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
 

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 ( )

Reimplemented from ILIAS_UI_TestBase.

Definition at line 41 of file ItemNotificationClientHtmlTest.php.

42 {
43 $factory = new class () extends NoUIFactory {
44 public function counter(): C\Counter\Factory
45 {
46 return new I\Counter\Factory();
47 }
48 public function button(): C\Button\Factory
49 {
50 return new I\Button\Factory($this->sig_gen);
51 }
52 public function symbol(): ILIAS\UI\Component\Symbol\Factory
53 {
54 return new I\Symbol\Factory(
55 new I\Symbol\Icon\Factory(),
56 new I\Symbol\Glyph\Factory(),
57 new I\Symbol\Avatar\Factory()
58 );
59 }
60 public function item(): C\Item\Factory
61 {
62 return new I\Item\Factory();
63 }
64 public function mainControls(): C\MainControls\Factory
65 {
66 return new I\MainControls\Factory(
67 $this->sig_gen,
68 new I\MainControls\Slate\Factory(
69 $this->sig_gen,
70 new \ILIAS\UI\Implementation\Component\Counter\Factory(),
71 $this->symbol()
72 )
73 );
74 }
75 };
76 $factory->sig_gen = $this->sig_gen;
77
78 return $factory;
79 }
$factory
Definition: metadata.php:75
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.

References $factory, and $sig_gen.

Referenced by testRenderClientHtml().

+ Here is the caller graph for this function:

◆ setUp()

ItemNotificationClientHtmlTest::setUp ( )

Reimplemented from ILIAS_UI_TestBase.

Definition at line 36 of file ItemNotificationClientHtmlTest.php.

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

◆ testRenderClientHtml()

ItemNotificationClientHtmlTest::testRenderClientHtml ( )

Definition at line 81 of file ItemNotificationClientHtmlTest.php.

81 : void
82 {
83 $f = $this->getUIFactory();
84 $expected_html = file_get_contents(__DIR__ . "/../../Client/Item/Notification/NotificationItemTest.html");
85
86 $icon = $f->symbol()->icon()->standard("name", "aria_label", "small", false);
87
88 $item = $f->item()->notification("item title", $icon)
89 ->withCloseAction("close_action");
90
91 $item2 = $item->withDescription("Existing Description")
92 ->withProperties(["Label 1" => "Property Value 1","Label 2" => "Property Value 2"])
93 ->withAggregateNotifications([$item]);
94 $notification_slate = $f->mainControls()->slate()->notification(
95 "slate title",
96 [$item,$item2]
97 );
98
99 $glyph = $f->symbol()->glyph()->notification()->withCounter($this->getUIFactory()->counter()->novelty(2));
100 $notification_center = $f->mainControls()->slate()->combined("notification center", $glyph)
101 ->withAdditionalEntry($notification_slate);
102
103 $this->metabar = $f->mainControls()->metaBar()->withAdditionalEntry("Test Slate", $notification_center);
104 $rendered_html = $this->getDefaultRenderer()->render($this->metabar);
105
106 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($rendered_html));
107 }
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:444
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355

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

+ Here is the call graph for this function:

Field Documentation

◆ $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: