19 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../../../../vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../Base.php");
34 return new I\Component\Dropdown\Factory();
41 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Dropdown\\Standard",
$f->standard(array()));
48 $c =
$f->standard(array())->withLabel(
"label");
50 $this->assertEquals(
"label",
$c->getLabel());
56 $link =
new I\Component\Link\Standard(
"Link to Github",
"http://www.github.com");
57 $c =
$f->standard(array(
61 $link->withOpenInNewViewport(
true)
63 $items =
$c->getItems();
65 $this->assertTrue(is_array($items));
66 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Shy", $items[0]);
67 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Divider\\Horizontal", $items[2]);
68 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Link\\Standard", $items[3]);
74 $r = $this->getDefaultRenderer();
76 $c =
$f->standard(array());
78 $html =
$r->render(
$c);
81 $this->assertEquals($expected, $html);
87 $r = $this->getDefaultRenderer();
89 $c =
$f->standard(array(
95 $html =
$r->render(
$c);
98 <div
class=
"dropdown" id=
"id_3">
99 <
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu">
100 <span
class=
"caret"></span>
102 <ul
id=
"id_3_menu" class=
"dropdown-menu">
103 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
105 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
110 $this->assertHTMLEquals($expected, $html);
116 $r = $this->getDefaultRenderer();
118 $c =
$f->standard(array(
122 ))->withLabel(
"label");
124 $html =
$r->render(
$c);
127 <div
class=
"dropdown" id=
"id_3"><
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu">label<span
class=
"caret"></span></
button>
128 <ul
id=
"id_3_menu" class=
"dropdown-menu">
129 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
131 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
136 $this->assertHTMLEquals($expected, $html);
142 $r = $this->getDefaultRenderer();
144 $link =
new I\Component\Link\Standard(
"Link to ILIAS",
"http://www.ilias.de");
146 $c =
$f->standard(array(
147 $link->withOpenInNewViewport(
true)
150 $html =
$r->render(
$c);
153 <div
class=
"dropdown" id=
"id_1"><
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_1_menu"><span
class=
"caret"></span></
button>
154 <ul
id=
"id_1_menu" class=
"dropdown-menu">
155 <li><a href=
"http://www.ilias.de" target=
"_blank" rel=
"noopener">
Link to ILIAS</a></li>
160 $this->assertHTMLEquals($expected, $html);
166 $r = $this->getDefaultRenderer();
168 $c =
$f->standard(array(
172 ))->withLabel(
"label")->withAriaLabel(
"my_aria_label");
174 $html =
$r->render(
$c);
177 <div
class=
"dropdown" id=
"id_3"><
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-label=
"my_aria_label" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu">label<span
class=
"caret"></span></
button>
178 <ul
id=
"id_3_menu" class=
"dropdown-menu">
179 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
181 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
186 $this->assertHTMLEquals($expected, $html);
button(string $caption, string $cmd)
testRenderWithLinkNewViewport()
Interface Observer Contains several chained tasks and infos about them.
testRenderItemsWithLabel()
testRenderItemsWithAriaLabel()
Test on card implementation.
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.
testImplementsFactoryInterface()