ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
DrilldownTest Class Reference

Tests for the Drilldown. More...

+ Inheritance diagram for DrilldownTest:
+ Collaboration diagram for DrilldownTest:

Public Member Functions

 getUIFactory ()
 
 setUp ()
 
 testConstruction ()
 
 testGetLabel (C\Menu\Drilldown $menu)
 testConstruction More...
 
 testGetItems ($menu)
 testConstruction More...
 
 testWithEntries ()
 
 testWithWrongEntry ()
 
 testRendering ()
 testWithEntries More...
 
 testWithPersistenceId ($menu)
 testConstruction More...
 
- 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

C Symbol Icon Standard $icon
 
C Symbol Glyph Glyph $glyph
 
C Button Standard $button
 
C Divider Horizontal $divider
 
C Legacy Legacy $legacy
 

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

Tests for the Drilldown.

Definition at line 31 of file DrilldownTest.php.

Member Function Documentation

◆ getUIFactory()

DrilldownTest::getUIFactory ( )

Definition at line 39 of file DrilldownTest.php.

References ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

Referenced by setUp(), testConstruction(), testRendering(), testWithEntries(), and testWithWrongEntry().

39  : NoUIFactory
40  {
41  return new class () extends NoUIFactory {
42  public function menu(): C\Menu\Factory
43  {
44  return new Menu\Factory(
45  new I\SignalGenerator()
46  );
47  }
48  public function button(): C\Button\Factory
49  {
50  return new I\Button\Factory();
51  }
52  public function legacy(string $content): C\Legacy\Legacy
53  {
54  return new I\Legacy\Legacy(
55  $content,
56  new I\SignalGenerator()
57  );
58  }
59  public function symbol(): \ILIAS\UI\Component\Symbol\Factory
60  {
61  return new I\Symbol\Factory(
62  new I\Symbol\Icon\Factory(),
63  new I\Symbol\Glyph\Factory(),
64  new I\Symbol\Avatar\Factory()
65  );
66  }
67  };
68  }
Class Factory.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

DrilldownTest::setUp ( )

Definition at line 70 of file DrilldownTest.php.

References getUIFactory(), and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

70  : void
71  {
72  $icon_factory = new I\Symbol\Icon\Factory();
73  $glyph_factory = new I\Symbol\Glyph\Factory();
74  $button_factory = new I\Button\Factory();
75  $divider_factory = new I\Divider\Factory();
76  $this->icon = $icon_factory->standard('', '');
77  $this->glyph = $glyph_factory->user('');
78  $this->button = $button_factory->standard('', '');
79  $this->divider = $divider_factory->horizontal();
80  $this->legacy = $this->getUIFactory()->legacy('');
81  }
+ Here is the call graph for this function:

◆ testConstruction()

DrilldownTest::testConstruction ( )

Definition at line 83 of file DrilldownTest.php.

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

83  : C\Menu\Drilldown
84  {
85  $f = $this->getUIFactory();
86  $menu = $f->menu()->drilldown('root', []);
87  $this->assertInstanceOf(
88  "ILIAS\\UI\\Component\\Menu\\Menu",
89  $menu
90  );
91  $this->assertInstanceOf(
92  "ILIAS\\UI\\Component\\Menu\\Drilldown",
93  $menu
94  );
95 
96  $menu = $f->menu()->drilldown('root', []);
97 
98  return $menu;
99  }
+ Here is the call graph for this function:

◆ testGetItems()

DrilldownTest::testGetItems (   $menu)

testConstruction

Definition at line 115 of file DrilldownTest.php.

115  : void
116  {
117  $this->assertEquals(
118  [],
119  $menu->getItems()
120  );
121  }

◆ testGetLabel()

DrilldownTest::testGetLabel ( C\Menu\Drilldown  $menu)

testConstruction

Definition at line 104 of file DrilldownTest.php.

104  : void
105  {
106  $this->assertEquals(
107  'root',
108  $menu->getLabel()
109  );
110  }

◆ testRendering()

DrilldownTest::testRendering ( )

testWithEntries

Definition at line 152 of file DrilldownTest.php.

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

152  : void
153  {
154  $r = $this->getDefaultRenderer();
155  $f = $this->getUIFactory();
156 
157  $items = [
158  $f->menu()->sub('1', [
159  $f->menu()->sub('1.1', []),
160  $f->menu()->sub('1.2', []),
161  ]),
162  $f->menu()->sub('2', [])
163  ];
164  $menu = $f->menu()->drilldown('root', $items);
165 
166  $html = $r->render($menu);
167  $expected = file_get_contents(__DIR__ . "/drilldown_test.html");
168 
169  $this->assertEquals(
170  $this->brutallyTrimHTML($expected),
171  $this->brutallyTrimHTML($html)
172  );
173  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:444
+ Here is the call graph for this function:

◆ testWithEntries()

DrilldownTest::testWithEntries ( )

Definition at line 123 of file DrilldownTest.php.

References $button, $divider, Vendor\Package\$f, and getUIFactory().

123  : C\Menu\Drilldown
124  {
125  $f = $this->getUIFactory();
126  $items = array(
127  $f->menu()->sub('sub', [
128  $this->button,
129  $this->glyph
130  ]),
133  );
134  $menu = $f->menu()->drilldown('root', $items);
135  $this->assertEquals(
136  $items,
137  $menu->getItems()
138  );
139  return $menu;
140  }
C Divider Horizontal $divider
C Button Standard $button
+ Here is the call graph for this function:

◆ testWithPersistenceId()

DrilldownTest::testWithPersistenceId (   $menu)

testConstruction

Definition at line 178 of file DrilldownTest.php.

References $id.

178  : void
179  {
180  $this->assertNull($menu->getPersistenceId()) ;
181 
182  $id = "some_id";
183  $this->assertEquals(
184  $id,
185  $menu->withPersistenceId($id)->getPersistenceId()
186  );
187  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ testWithWrongEntry()

DrilldownTest::testWithWrongEntry ( )

Definition at line 142 of file DrilldownTest.php.

References Vendor\Package\$f, getUIFactory(), and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

142  : void
143  {
144  $this->expectException(InvalidArgumentException::class);
145  $f = $this->getUIFactory();
146  $f->menu()->drilldown('label', [$this->legacy]);
147  }
+ Here is the call graph for this function:

Field Documentation

◆ $button

C Button Standard DrilldownTest::$button
protected

Definition at line 35 of file DrilldownTest.php.

Referenced by testWithEntries().

◆ $divider

C Divider Horizontal DrilldownTest::$divider
protected

Definition at line 36 of file DrilldownTest.php.

Referenced by testWithEntries().

◆ $glyph

C Symbol Glyph Glyph DrilldownTest::$glyph
protected

Definition at line 34 of file DrilldownTest.php.

◆ $icon

C Symbol Icon Standard DrilldownTest::$icon
protected

Definition at line 33 of file DrilldownTest.php.

◆ $legacy

C Legacy Legacy DrilldownTest::$legacy
protected

Definition at line 37 of file DrilldownTest.php.


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