ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 

Protected Attributes

 $sig_gen
 
C MainControls MetaBar $metabar
 

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 {
46  public I\SignalGenerator $sig_gen;
47 
48  public function counter(): I\Counter\Factory
49  {
50  return new I\Counter\Factory();
51  }
52  public function button(): I\Button\Factory
53  {
54  return new I\Button\Factory();
55  }
56  public function symbol(): I\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(): I\Item\Factory
65  {
66  return new I\Item\Factory();
67  }
68  public function mainControls(): I\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)
Interface Observer Contains several chained tasks and infos about them.
+ 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, 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  }
+ 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: