5 require_once(__DIR__ .
"/../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../Base.php");
8 use \ILIAS\UI\Component as
C;
9 use \ILIAS\UI\Implementation as
I;
10 use \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());
62 $this->assertFalse(
$b->isEngageable());
64 $b = $b->withEngagedState(
true);
65 $this->assertInstanceOf(
66 "ILIAS\\UI\\Component\\Button\\Bulky",
69 $this->assertTrue($b->isEngaged());
70 $this->assertTrue($b->isEngageable());
75 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de");
76 $this->assertFalse(
$b->isEngaged());
77 $this->assertFalse(
$b->isEngageable());
79 $b = $b->withEngagedState(
false);
80 $this->assertInstanceOf(
81 "ILIAS\\UI\\Component\\Button\\Bulky",
84 $this->assertFalse($b->isEngaged());
85 $this->assertTrue($b->isEngageable());
91 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
93 $this->assertEquals(
"menuitem",
$b->getAriaRole());
95 $this->assertFalse(
"This should not happen");
102 $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
103 ->withAriaRole(
"loremipsum");
104 $this->assertFalse(
"This should not happen");
106 $this->assertTrue(
true);
113 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de");
124 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
125 ->withEngagedState(
true);
136 $b = $this->button_factory->bulky($this->glyph,
"label",
"http://www.ilias.de")
137 ->withEngagedState(
true);
150 $aria_pressed =
" aria-pressed='true'";
151 $engaged_class =
" engaged";
153 $aria_pressed =
" aria-pressed='false'";
154 $engaged_class =
" disengaged";
158 .
'<button class="btn btn-bulky' . $engaged_class .
'" data-action="http://www.ilias.de" id="id_1" ' . $aria_pressed .
'>' 159 .
' <span class="glyph" aria-label="briefcase" role="img">' 160 .
' <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>' 162 .
' <span class="bulky-label">label</span>' 169 $b = $this->button_factory->bulky($this->icon,
"label",
"http://www.ilias.de");
172 .
'<button class="btn btn-bulky" data-action="http://www.ilias.de" id="id_1">' 173 .
' <img class="icon someExample small" src="./templates/default/images/icon_default.svg" alt="Example"/>' 174 .
' <span class="bulky-label">label</span>' 186 $b = $this->button_factory->bulky($this->icon,
"label",
"http://www.ilias.de")
190 .
'<button class="btn btn-bulky" data-action="http://www.ilias.de" id="id_1" role="menuitem">' 191 .
' <img class="icon someExample small" src="./templates/default/images/icon_default.svg" alt="Example"/>' 192 .
' <span class="bulky-label">label</span>' 204 $b = $this->button_factory->bulky($this->icon,
"label",
"http://www.ilias.de")
205 ->withEngagedState(
false)
209 .
'<button class="btn btn-bulky" data-action="http://www.ilias.de" id="id_1" role="menuitem" aria-haspopup="true">' 210 .
' <img class="icon someExample small" src="./templates/default/images/icon_default.svg" alt="Example"/>' 211 .
' <span class="bulky-label">label</span>'
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])