ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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...
 

Protected Attributes

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

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\Repository\button(), ILIAS\UI\examples\MainControls\Slate\Legacy\legacy(), and ILIAS\Repository\symbol().

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

39  : NoUIFactory
40  {
41  return new class () extends NoUIFactory {
42  public function menu(): I\Menu\Factory
43  {
44  return new Menu\Factory(
45  new I\SignalGenerator(),
46  );
47  }
48  public function button(): I\Button\Factory
49  {
50  return new I\Button\Factory();
51  }
52  public function legacy(): I\Legacy\Factory
53  {
54  return new I\Legacy\Factory(new I\SignalGenerator());
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  };
65  }
button(string $caption, string $cmd)
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setUp()

DrilldownTest::setUp ( )

Definition at line 67 of file DrilldownTest.php.

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

67  : void
68  {
69  $icon_factory = new I\Symbol\Icon\Factory();
70  $glyph_factory = new I\Symbol\Glyph\Factory();
71  $button_factory = new I\Button\Factory();
72  $divider_factory = new I\Divider\Factory();
73  $this->icon = $icon_factory->standard('', '');
74  $this->glyph = $glyph_factory->user('');
75  $this->button = $button_factory->standard('', '');
76  $this->divider = $divider_factory->horizontal();
77  $this->legacy = $this->getUIFactory()->legacy()->content('');
78  }
button(string $caption, string $cmd)
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
+ Here is the call graph for this function:

◆ testConstruction()

DrilldownTest::testConstruction ( )

Definition at line 80 of file DrilldownTest.php.

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

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

◆ testGetItems()

DrilldownTest::testGetItems (   $menu)

testConstruction

Definition at line 112 of file DrilldownTest.php.

112  : void
113  {
114  $this->assertEquals(
115  [],
116  $menu->getItems()
117  );
118  }

◆ testGetLabel()

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

testConstruction

Definition at line 101 of file DrilldownTest.php.

101  : void
102  {
103  $this->assertEquals(
104  'root',
105  $menu->getLabel()
106  );
107  }

◆ testRendering()

DrilldownTest::testRendering ( )

testWithEntries

Definition at line 149 of file DrilldownTest.php.

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

149  : void
150  {
151  $r = $this->getDefaultRenderer();
152  $f = $this->getUIFactory();
153 
154  $items = [
155  $f->menu()->sub('1', [
156  $f->menu()->sub('1.1', []),
157  $f->menu()->sub('1.2', []),
158  ]),
159  $f->menu()->sub('2', [])
160  ];
161  $menu = $f->menu()->drilldown('root', $items);
162 
163  $html = $r->render($menu);
164  $expected = file_get_contents(__DIR__ . "/drilldown_test.html");
165 
166  $this->assertEquals(
167  $this->brutallyTrimHTML($expected),
168  $this->brutallyTrimHTML($html)
169  );
170  }
$r
+ Here is the call graph for this function:

◆ testWithEntries()

DrilldownTest::testWithEntries ( )

Definition at line 120 of file DrilldownTest.php.

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

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

◆ testWithPersistenceId()

DrilldownTest::testWithPersistenceId (   $menu)

testConstruction

Definition at line 175 of file DrilldownTest.php.

References $id.

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

◆ testWithWrongEntry()

DrilldownTest::testWithWrongEntry ( )

Definition at line 139 of file DrilldownTest.php.

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

139  : void
140  {
141  $this->expectException(InvalidArgumentException::class);
142  $f = $this->getUIFactory();
143  $f->menu()->drilldown('label', [$this->legacy]);
144  }
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
+ 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 Content DrilldownTest::$legacy
protected

Definition at line 37 of file DrilldownTest.php.


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