Test secondary legacy panels.
More...
Test secondary legacy panels.
Definition at line 31 of file PanelSecondaryLegacyTest.php.
◆ cleanHTML()
| PanelSecondaryLegacyTest::cleanHTML |
( |
string |
$html | ) |
|
|
protected |
◆ getUIFactory()
| PanelSecondaryLegacyTest::getUIFactory |
( |
| ) |
|
Definition at line 33 of file PanelSecondaryLegacyTest.php.
References Vendor\Package\$f, ILIAS\Repository\button(), ILIAS\UI\examples\MainControls\Slate\Legacy\legacy(), and ILIAS\Repository\symbol().
Referenced by testGetLegacyComponent(), testGetTitle(), testImplementsFactoryInterface(), testRenderPanelSecondaryWithActions(), testRenderPanelSecondaryWithFooter(), testRenderPanelSecondaryWithNoHeader(), testRenderPanelSecondaryWithPagination(), testRenderPanelSecondaryWithSection(), testRenderPanelSecondaryWithSortation(), testWithActions(), testWithoutViewControls(), testWithPaginationViewControl(), testWithSectionViewControl(), and testWithSortationViewControl().
36 public function legacyPanel(
string $title,
C\Legacy\Legacy $content):
I\
Component\Panel\Secondary\Legacy
38 return new I\Component\Panel\Secondary\Legacy($title, $content);
41 public function legacy(
string $content):
C\Legacy\Legacy
44 return $f->legacy($content);
47 public function dropdown():
C\Dropdown\
Factory 49 return new I\Component\Dropdown\Factory();
59 return new I\Component\Button\Factory();
64 return new I\Component\Symbol\Factory(
button(string $caption, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testGetLegacyComponent()
| PanelSecondaryLegacyTest::testGetLegacyComponent |
( |
| ) |
|
◆ testGetTitle()
| PanelSecondaryLegacyTest::testGetTitle |
( |
| ) |
|
◆ testImplementsFactoryInterface()
| PanelSecondaryLegacyTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testRenderPanelSecondaryWithActions()
| PanelSecondaryLegacyTest::testRenderPanelSecondaryWithActions |
( |
| ) |
|
Definition at line 180 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS\Repository\button(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
182 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
183 $actions = $this->
getUIFactory()->dropdown()->standard(array(
188 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)->withActions($actions);
192 $expected_html = <<<EOT
193 <div
class=
"panel panel-secondary panel-flex">
194 <div
class=
"panel-heading ilHeader">
195 <div
class=
"panel-title"><h2>
Title</h2></div>
196 <div
class=
"panel-controls">
197 <div
class=
"dropdown"><
button class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" id=
"id_3" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu" ><span
class=
"caret"></span></
button>
198 <ul
id=
"id_3_menu" class=
"dropdown-menu">
199 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
200 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">Github</button></li>
206 <div
class=
"panel-body">
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
button(string $caption, string $cmd)
Class ChatMainBarProvider .
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ testRenderPanelSecondaryWithFooter()
| PanelSecondaryLegacyTest::testRenderPanelSecondaryWithFooter |
( |
| ) |
|
Definition at line 327 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS\Repository\button(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
329 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
330 $footer_shy_button = $this->
getUIFactory()->button()->shy(
"Action",
"");
332 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
333 ->withFooter($footer_shy_button);
337 $expected_html = <<<EOT
338 <div
class=
"panel panel-secondary panel-flex">
339 <div
class=
"panel-heading ilHeader">
340 <div
class=
"panel-title"><h2>
Title</h2></div>
341 <div
class=
"panel-controls"></div>
343 <div
class=
"panel-body">
346 <div
class=
"panel-footer ilBlockInfo">
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
button(string $caption, string $cmd)
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderPanelSecondaryWithNoHeader()
| PanelSecondaryLegacyTest::testRenderPanelSecondaryWithNoHeader |
( |
| ) |
|
◆ testRenderPanelSecondaryWithPagination()
| PanelSecondaryLegacyTest::testRenderPanelSecondaryWithPagination |
( |
| ) |
|
Definition at line 257 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS\Repository\button(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
259 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
261 $pagination = $this->
getUIFactory()->viewControl()->pagination()
262 ->withTargetURL(
'http://ilias.de',
'page')
263 ->withTotalEntries(10)
265 ->withCurrentPage(1);
267 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
268 ->withViewControls([$pagination]);
272 $expected_html = <<<EOT
273 <div
class=
"panel panel-secondary panel-flex">
274 <div
class=
"panel-heading ilHeader">
275 <div
class=
"panel-title"><h2>
Title</h2></div>
276 <div
class=
"panel-viewcontrols l-bar__space-keeper">
277 <div
class=
"il-viewcontrol-pagination l-bar__element">
278 <span
class=
"btn btn-ctrl browse previous"><a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=0" aria-label=
"back"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></a></span>
279 <
button class=
"btn btn-link" data-action=
"http://ilias.de?page=0" id=
"id_1">1</button>
280 <button
class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"http://ilias.de?page=1" id=
"id_2">2</button>
281 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=2" id=
"id_3">3</button>
282 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=3" id=
"id_4">4</button>
283 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=4" id=
"id_5">5</button>
284 <span
class=
"btn btn-ctrl browse next"><a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=2" aria-label=
"next"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></a></span>
287 <div
class=
"panel-controls"></div>
289 <div
class=
"panel-body">Legacy content</div>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
button(string $caption, string $cmd)
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderPanelSecondaryWithSection()
| PanelSecondaryLegacyTest::testRenderPanelSecondaryWithSection |
( |
| ) |
|
Definition at line 295 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS\Repository\button(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
297 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
298 $back = $this->
getUIFactory()->button()->standard(
"previous",
"http://www.ilias.de");
299 $next = $this->
getUIFactory()->button()->standard(
"next",
"http://www.github.com");
300 $current = $this->
getUIFactory()->button()->standard(
"current",
"");
301 $section = $this->
getUIFactory()->viewControl()->section($back, $current, $next);
303 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
304 ->withViewControls([$section]);
308 $expected_html = <<<EOT
309 <div
class=
"panel panel-secondary panel-flex">
310 <div
class=
"panel-heading ilHeader">
311 <div
class=
"panel-title"><h2>
Title</h2></div>
312 <div
class=
"panel-viewcontrols l-bar__space-keeper">
313 <div
class=
"il-viewcontrol-section l-bar__element">
314 <a
class=
"btn btn-ctrl browse previous" href=
"http://www.ilias.de" aria-label=
"previous" data-action=
"http://www.ilias.de" id=
"id_1"><span
class=
"glyphicon glyphicon-chevron-left"></span></a>
315 <
button class=
"btn btn-default" data-action=
"">current</button>
316 <a
class=
"btn btn-ctrl browse next" href=
"http://www.github.com" aria-label=
"next" data-action=
"http://www.github.com" id=
"id_2"><span
class=
"glyphicon glyphicon-chevron-right"></span></a>
319 <div
class=
"panel-controls"></div>
321 <div
class=
"panel-body">Legacy content</div>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
button(string $caption, string $cmd)
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testRenderPanelSecondaryWithSortation()
| PanelSecondaryLegacyTest::testRenderPanelSecondaryWithSortation |
( |
| ) |
|
Definition at line 217 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS\Repository\button(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
219 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
220 $sort_options = array(
224 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options);
225 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
226 ->withViewControls([$sortation]);
230 $expected_html = <<<EOT
231 <div
class=
"panel panel-secondary panel-flex">
232 <div
class=
"panel-heading ilHeader">
233 <div
class=
"panel-title"><h2>
Title</h2></div>
234 <div
class=
"panel-viewcontrols l-bar__space-keeper">
235 <div
class=
"il-viewcontrol-sortation l-bar__element" id=
"id_1">
236 <div
class=
"dropdown">
237 <
button class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" id=
"id_4" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_4_menu">
238 <span
class=
"caret"></span>
240 <ul
id=
"id_4_menu" class=
"dropdown-menu">
241 <li><
button class=
"btn btn-link" data-action=
"?sortation=a" id=
"id_2">
A</button></li>
242 <li><button
class=
"btn btn-link" data-action=
"?sortation=b" id=
"id_3">
B</button></li>
247 <div
class=
"panel-controls"></div>
249 <div
class=
"panel-body">
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
button(string $caption, string $cmd)
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
◆ testWithActions()
| PanelSecondaryLegacyTest::testWithActions |
( |
| ) |
|
◆ testWithoutViewControls()
| PanelSecondaryLegacyTest::testWithoutViewControls |
( |
| ) |
|
◆ testWithPaginationViewControl()
| PanelSecondaryLegacyTest::testWithPaginationViewControl |
( |
| ) |
|
Definition at line 145 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
147 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
148 $pagination = $this->
getUIFactory()->viewControl()->pagination()
149 ->withTargetURL(
"http://ilias.de",
'page')
150 ->withTotalEntries(98)
152 ->withCurrentPage(1);
154 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
155 ->withViewControls([$pagination]);
157 $array_vc = $secondary_panel->getViewControls();
159 $this->assertEquals($array_vc[0], $pagination);
◆ testWithSectionViewControl()
| PanelSecondaryLegacyTest::testWithSectionViewControl |
( |
| ) |
|
Definition at line 162 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
164 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
165 $back = $this->
getUIFactory()->button()->standard(
"previous",
"http://www.ilias.de");
166 $next = $this->
getUIFactory()->button()->standard(
"next",
"http://www.github.com");
167 $current = $this->
getUIFactory()->button()->standard(
"current",
"");
168 $section = $this->
getUIFactory()->viewControl()->section($back, $current, $next);
170 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
171 ->withViewControls([$section]);
173 $array_vc = $secondary_panel->getViewControls();
175 $this->assertEquals($array_vc[0], $section);
◆ testWithSortationViewControl()
| PanelSecondaryLegacyTest::testWithSortationViewControl |
( |
| ) |
|
Definition at line 127 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
129 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
130 $sort_options = array(
131 'internal_rating' =>
'Best',
132 'date_desc' =>
'Most Recent',
133 'date_asc' =>
'Oldest',
135 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options);
137 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
138 ->withViewControls([$sortation]);
140 $array_vc = $secondary_panel->getViewControls();
142 $this->assertEquals($array_vc[0], $sortation);
The documentation for this class was generated from the following file: