5require_once(__DIR__ .
"/../../../../libs/composer/vendor/autoload.php");
6require_once(__DIR__ .
"/../../Base.php");
8use \ILIAS\UI\Component as
C;
9use \ILIAS\UI\Implementation as I;
10use \ILIAS\UI\Implementation\Component\Signal;
19 $this->button_factory =
new I\Component\Button\Factory();
20 $this->glyph =
new I\Component\Symbol\Glyph\Glyph(
"briefcase",
"briefcase");
21 $this->icon =
new I\Component\Symbol\Icon\Standard(
"someExample",
"Example",
"small",
false);
26 $this->assertInstanceOf(
27 "ILIAS\\UI\\Component\\Button\\Bulky",
28 $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
34 $this->expectException(\TypeError::class);
36 $f = $this->button_factory;
37 $f->bulky(
new StdClass(),
"",
"http://www.ilias.de");
42 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de");
51 $b = $this->button_factory->bulky($this->icon,
"label",
"http://www.ilias.de");
60 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de");
61 $this->assertFalse(
$b->isEngaged());
63 $b =
$b->withEngagedState(
true);
64 $this->assertInstanceOf(
65 "ILIAS\\UI\\Component\\Button\\Bulky",
68 $this->assertTrue(
$b->isEngaged());
74 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
75 ->withAriaRole(I\Component\
Button\Bulky::MENUITEM);
76 $this->assertEquals(
"menuitem",
$b->getAriaRole());
77 }
catch (\InvalidArgumentException
$e) {
78 $this->assertFalse(
"This should not happen");
85 $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
86 ->withAriaRole(
"loremipsum");
87 $this->assertFalse(
"This should not happen");
88 }
catch (\InvalidArgumentException
$e) {
89 $this->assertTrue(
true);
96 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de");
99 .
'<button class="btn btn-bulky" data-action="http://www.ilias.de" id="id_1">'
100 .
' <span class="glyph" aria-label="briefcase">'
101 .
' <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>'
103 .
' <span class="bulky-label">label</span>'
115 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
116 ->withEngagedState(
true);
118 .
'<button class="btn btn-bulky engaged" data-action="http://www.ilias.de" id="id_1" aria-pressed="true">'
119 .
' <span class="glyph" aria-label="briefcase">'
120 .
' <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>'
122 .
' <span class="bulky-label">label</span>'
134 $b = $this->button_factory->bulky($this->icon,
"label",
"http://www.ilias.de");
137 .
'<button class="btn btn-bulky" data-action="http://www.ilias.de" id="id_1">'
138 .
' <div class="icon someExample small" aria-label="Example"></div>'
139 .
' <span class="bulky-label">label</span>'
151 $b = $this->button_factory->bulky($this->icon,
"label",
"http://www.ilias.de")
152 ->withAriaRole(I\Component\
Button\Bulky::MENUITEM);
155 .
'<button class="btn btn-bulky" data-action="http://www.ilias.de" id="id_1" role="menuitem" aria-haspopup="true">'
156 .
' <div class="icon someExample small" aria-label="Example"></div>'
157 .
' <span class="bulky-label">label</span>'
An exception for terminatinating execution or to throw for unit testing.
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)
getDefaultRenderer(JavaScriptBinding $js_binding=null)