19 declare(strict_types=1);
21 require_once(
"vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../../Base.php");
33 protected C\Symbol\Icon\Standard
$icon;
34 protected C\Symbol\Glyph\Glyph
$glyph;
42 public function menu(): I\Menu\Factory
45 new I\SignalGenerator(),
48 public function button(): I\Button\Factory
50 return new I\Button\Factory();
52 public function legacy(): I\Legacy\Factory
54 return new I\Legacy\Factory(
new I\SignalGenerator());
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()
button(string $caption, string $cmd)
C Symbol Glyph Glyph $glyph
C Symbol Icon Standard $icon
C Divider Horizontal $divider
legacy()
expected output: > ILIAS shows the rendered Component.
testWithPersistenceId($menu)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
C Button Standard $button
testGetLabel(C\Menu\Drilldown $menu)