Tests for the Main Bar.
More...
Tests for the Main Bar.
Definition at line 18 of file MainBarTest.php.
◆ getButton()
MainBarTest::getButton |
( |
| ) |
|
|
protected |
◆ getLink()
Definition at line 76 of file MainBarTest.php.
Referenced by testAddEntry().
78 $symbol = $this->icon_factory->custom(
'',
'');
79 $target =
new Data\URI(
"http://www.ilias.de");
80 return $this->link_factory->bulky($symbol,
'TestEntry', $target);
◆ getSlate()
MainBarTest::getSlate |
( |
| ) |
|
|
protected |
◆ setUp()
Definition at line 41 of file MainBarTest.php.
References mainbar().
44 $this->button_factory =
new I\Button\Factory();
45 $this->link_factory =
new I\Link\Factory();
46 $this->icon_factory =
new I\Symbol\Icon\Factory();
47 $counter_factory =
new I\Counter\Factory();
48 $slate_factory =
new I\MainControls\Slate\Factory(
57 $this->factory =
new I\MainControls\Factory($sig_gen, $slate_factory);
59 $this->
mainbar = $this->factory->mainBar();
◆ testActive()
MainBarTest::testActive |
( |
C\MainControls\MainBar |
$mb | ) |
|
testAddEntry
Definition at line 163 of file MainBarTest.php.
165 $mb = $mb->withActive(
'testbtn');
166 $this->assertEquals(
'testbtn', $mb->getActive());
◆ testAddEntry()
MainBarTest::testAddEntry |
( |
| ) |
|
Definition at line 95 of file MainBarTest.php.
References getButton(), getLink(), and mainbar().
95 : C\MainControls\MainBar
100 ->withAdditionalEntry(
'testbtn', $btn)
101 ->withAdditionalEntry(
'testlnk', $lnk);
103 $entries = $mb->getEntries();
108 $this->assertEquals($expected, $entries);
◆ testAddToolEntry()
MainBarTest::testAddToolEntry |
( |
| ) |
|
◆ testAddToolEntryWithoutToolsButton()
MainBarTest::testAddToolEntryWithoutToolsButton |
( |
| ) |
|
◆ testConstruction()
MainBarTest::testConstruction |
( |
| ) |
|
Definition at line 62 of file MainBarTest.php.
References mainbar().
64 $this->assertInstanceOf(
65 "ILIAS\\UI\\Component\\MainControls\\MainBar",
◆ testDisallowedEntry()
MainBarTest::testDisallowedEntry |
( |
| ) |
|
Definition at line 112 of file MainBarTest.php.
References mainbar().
114 $this->expectException(InvalidArgumentException::class);
115 $this->
mainbar->withAdditionalEntry(
'test',
'wrong_param');
◆ testDisallowedToolEntry()
MainBarTest::testDisallowedToolEntry |
( |
| ) |
|
Definition at line 127 of file MainBarTest.php.
References mainbar().
129 $this->expectException(\TypeError::class);
130 $this->
mainbar->withAdditionalToolEntry(
'test',
'wrong_param');
◆ testDouplicateIdEntry()
MainBarTest::testDouplicateIdEntry |
( |
| ) |
|
Definition at line 118 of file MainBarTest.php.
References getButton(), and mainbar().
120 $this->expectException(InvalidArgumentException::class);
123 ->withAdditionalEntry(
'test', $btn)
124 ->withAdditionalEntry(
'test', $btn);
◆ testDouplicateIdToolEntry()
MainBarTest::testDouplicateIdToolEntry |
( |
| ) |
|
Definition at line 149 of file MainBarTest.php.
References getButton(), getSlate(), and mainbar().
151 $this->expectException(InvalidArgumentException::class);
155 ->withToolsButton($btn)
156 ->withAdditionalToolEntry(
'test', $slate)
157 ->withAdditionalToolEntry(
'test', $slate);
◆ testRendering()
MainBarTest::testRendering |
( |
| ) |
|
Definition at line 225 of file MainBarTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), close(), getButton(), and ILIAS_UI_TestBase\getDefaultRenderer().
228 $icon = $this->icon_factory->custom(
'',
'');
230 $sf = $this->factory->slate();
231 $slate = $sf->combined(
'1', $icon)
232 ->withAdditionalEntry(
233 $sf->combined(
'1.1', $icon)
234 ->withAdditionalEntry(
235 $sf->combined(
'1.1.1', $icon)
239 $toolslate = $sf->legacy(
'Help', $icon,
new I\
Legacy\
Legacy(
'Help',
new I\SignalGenerator()));
241 $mb = $this->factory->mainBar()
242 ->withAdditionalEntry(
'test1', $this->
getButton())
243 ->withAdditionalEntry(
'test2', $this->
getButton())
244 ->withAdditionalEntry(
'slate', $slate)
246 ->withAdditionalToolEntry(
'tool1', $toolslate);
248 $html = $r->render($mb);
251 <div
class=
"il-maincontrols-mainbar" id=
"id_16">
252 <nav
class=
"il-mainbar" aria-label=
"mainbar_aria_label">
254 <div
class=
"il-mainbar-tools-button">
255 <button
class=
"btn btn-bulky" id=
"id_14"><img
class=
"icon custom small" src=
"" alt=
""/><span
class=
"bulky-label">TestEntry</span></button>
258 <div
class=
"il-mainbar-triggers">
259 <ul
class=
"il-mainbar-entries" role=
"menubar" style=
"visibility: hidden">
260 <li role=
"none"><button
class=
"btn btn-bulky" data-action=
"#" id=
"id_1" role=
"menuitem" ><img
class=
"icon custom small" src=
"" alt=
""/><span
class=
"bulky-label">TestEntry</span></button></li>
261 <li role=
"none"><button
class=
"btn btn-bulky" data-action=
"#" id=
"id_2" role=
"menuitem" ><img
class=
"icon custom small" src=
"" alt=
""/><span
class=
"bulky-label">TestEntry</span></button></li>
262 <li role=
"none"><button
class=
"btn btn-bulky" id=
"id_3" role=
"menuitem" ><img
class=
"icon custom small" src=
"" alt=
""/><span
class=
"bulky-label">1</span></button></li>
263 <li role=
"none"><button
class=
"btn btn-bulky" id=
"id_9" role=
"menuitem" ><span
class=
"glyph" aria-label=
"show_more" role=
"img"><span
class=
"glyphicon glyphicon-option-horizontal" aria-hidden=
"true"></span></span><span
class=
"bulky-label">mainbar_more_label</span></button></li>
268 <div
class=
"il-mainbar-slates">
269 <div
class=
"il-mainbar-tools-entries">
270 <ul
class=
"il-mainbar-tools-entries-bg" role=
"menubar">
271 <li
class=
"il-mainbar-tool-trigger-item" role=
"none">
272 <button
class=
"btn btn-bulky" id=
"id_11" role=
"menuitem"><img
class=
"icon custom small" src=
"" alt=
""/><span
class=
"bulky-label">Help</span></button>
276 <div
class=
"il-maincontrols-slate disengaged" id=
"id_8" data-depth-level=
"1" role=
"menu">
277 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content">
278 <button
class=
"btn btn-bulky" id=
"id_4" ><img
class=
"icon custom small" src=
"" alt=
""/><span
class=
"bulky-label">1.1</span></button>
280 <div
class=
"il-maincontrols-slate disengaged" id=
"id_7" data-depth-level=
"2">
281 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content">
282 <button
class=
"btn btn-bulky" id=
"id_5" ><img
class=
"icon custom small" src=
"" alt=
""/><span
class=
"bulky-label">1.1.1</span></button>
284 <div
class=
"il-maincontrols-slate disengaged" id=
"id_6" data-depth-level=
"3">
285 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content"></div>
293 <div
class=
"il-maincontrols-slate disengaged" id=
"id_10" data-depth-level=
"1" role=
"menu">
294 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content"></div>
297 <div
class=
"il-maincontrols-slate disengaged" id=
"id_13" data-depth-level=
"1" role=
"menu">
298 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content">Help</div>
302 <div
class=
"il-mainbar-close-slates">
303 <button
class=
"btn btn-bulky" id=
"id_15" >
304 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
305 <span
class=
"bulky-label">
close</span></button>
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])
◆ testSignalsPresent()
MainBarTest::testSignalsPresent |
( |
| ) |
|
◆ testWithInvalidActive()
MainBarTest::testWithInvalidActive |
( |
| ) |
|
Definition at line 169 of file MainBarTest.php.
References mainbar().
171 $this->expectException(InvalidArgumentException::class);
172 $this->
mainbar->withActive(
'this-is-not-a-valid-entry');
◆ $button_factory
MainBarTest::$button_factory |
|
protected |
◆ $factory
◆ $icon_factory
MainBarTest::$icon_factory |
|
protected |
◆ $link_factory
MainBarTest::$link_factory |
|
protected |
◆ $mainbar
The documentation for this class was generated from the following file: