19declare(strict_types=1);
21require_once(
"vendor/composer/vendor/autoload.php");
22require_once(__DIR__ .
"/../../../Base.php");
42 public function menu(): I\Menu\Factory
48 public function button(): I\Button\Factory
50 return new I\Button\Factory();
52 public function legacy(): I\Legacy\Factory
56 public function symbol(): I\Symbol\Factory
58 return new I\Symbol\Factory(
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();
83 $menu =
$f->menu()->drilldown(
'root', []);
84 $this->assertInstanceOf(
85 "ILIAS\\UI\\Component\\Menu\\Menu",
88 $this->assertInstanceOf(
89 "ILIAS\\UI\\Component\\Menu\\Drilldown",
93 $menu =
$f->menu()->drilldown(
'root', []);
98 #[\PHPUnit\Framework\Attributes\Depends('testConstruction')]
107 #[\PHPUnit\Framework\Attributes\Depends('testConstruction')]
120 $f->menu()->sub(
'sub', [
127 $menu =
$f->menu()->drilldown(
'root', $items);
137 $this->expectException(InvalidArgumentException::class);
139 $f->menu()->drilldown(
'label', [$this->
legacy]);
142 #[\PHPUnit\Framework\Attributes\Depends('testWithEntries')]
145 $r = $this->getDefaultRenderer();
149 $f->menu()->sub(
'1', [
150 $f->menu()->sub(
'1.1', []),
151 $f->menu()->sub(
'1.2', []),
153 $f->menu()->sub(
'2', [])
155 $menu =
$f->menu()->drilldown(
'root', $items);
157 $html = $r->render($menu);
158 $expected = file_get_contents(__DIR__ .
"/drilldown_test.html");
161 $this->brutallyTrimHTML($expected),
162 $this->brutallyTrimHTML($html)
166 #[\PHPUnit\Framework\Attributes\Depends('testConstruction')]
169 $this->assertNull($menu->getPersistenceId()) ;
174 $menu->withPersistenceId(
$id)->getPersistenceId()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
testGetLabel(C\Menu\Drilldown $menu)
testWithPersistenceId($menu)
C Symbol Icon Standard $icon
C Button Standard $button
C Divider Horizontal $divider
C Symbol Glyph Glyph $glyph
Provides common functionality for UI tests.
button(string $caption, string $cmd)