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, and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().
Referenced by test_get_legacy_component(), test_get_title(), test_implements_factory_interface(), test_render_with_actions(), test_render_with_footer(), test_render_with_no_header(), test_render_with_pagination(), test_render_with_section(), test_render_with_sortation(), test_with_actions(), test_with_pagination_viewcontrol(), test_with_section_viewcontrol(), test_with_sortation_viewcontrol(), and test_without_viewcontrols().
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();
62 public function symbol():
C\Symbol\
Factory 64 return new I\Component\Symbol\Factory(
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...
◆ test_get_legacy_component()
PanelSecondaryLegacyTest::test_get_legacy_component |
( |
| ) |
|
◆ test_get_title()
PanelSecondaryLegacyTest::test_get_title |
( |
| ) |
|
◆ test_implements_factory_interface()
PanelSecondaryLegacyTest::test_implements_factory_interface |
( |
| ) |
|
◆ test_render_with_actions()
PanelSecondaryLegacyTest::test_render_with_actions |
( |
| ) |
|
Definition at line 180 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
182 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
183 $actions = $this->
getUIFactory()->dropdown()->standard(array(
184 $this->
getUIFactory()->button()->shy(
"ILIAS",
"https://www.ilias.de"),
185 $this->
getUIFactory()->button()->shy(
"Github",
"https://www.github.com")
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">
196 <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>
197 <ul
id=
"id_3_menu" class=
"dropdown-menu">
198 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
199 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">Github</button></li>
203 <div
class=
"panel-body">
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Class ChatMainBarProvider .
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_with_footer()
PanelSecondaryLegacyTest::test_render_with_footer |
( |
| ) |
|
◆ test_render_with_no_header()
PanelSecondaryLegacyTest::test_render_with_no_header |
( |
| ) |
|
◆ test_render_with_pagination()
PanelSecondaryLegacyTest::test_render_with_pagination |
( |
| ) |
|
Definition at line 254 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
256 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
258 $pagination = $this->
getUIFactory()->viewControl()->pagination()
259 ->withTargetURL(
'http://ilias.de',
'page')
260 ->withTotalEntries(10)
262 ->withCurrentPage(1);
264 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
265 ->withViewControls([$pagination]);
269 $expected_html = <<<EOT
270 <div
class=
"panel panel-secondary panel-flex">
271 <div
class=
"panel-heading ilHeader">
273 <div
class=
"il-viewcontrol-pagination">
274 <span
class=
"browse previous">
275 <a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=0" aria-label=
"back">
276 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></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=
"browse next">
285 <a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=2" aria-label=
"next">
286 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
291 <div
class=
"panel-body">
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_with_section()
PanelSecondaryLegacyTest::test_render_with_section |
( |
| ) |
|
Definition at line 302 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
304 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
305 $back = $this->
getUIFactory()->button()->standard(
"previous",
"http://www.ilias.de");
306 $next = $this->
getUIFactory()->button()->standard(
"next",
"http://www.github.com");
307 $current = $this->
getUIFactory()->button()->standard(
"current",
"");
308 $section = $this->
getUIFactory()->viewControl()->section($back, $current, $next);
310 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
311 ->withViewControls([$section]);
315 $expected_html = <<<EOT
316 <div
class=
"panel panel-secondary panel-flex">
317 <div
class=
"panel-heading ilHeader">
319 <div
class=
"il-viewcontrol-section">
320 <a
class=
"btn btn-default " href=
"http://www.ilias.de" aria-label=
"previous" data-action=
"http://www.ilias.de" id=
"id_1">
321 <span
class=
"glyphicon glyphicon-chevron-left"></span>
323 <button
class=
"btn btn-default" data-action=
"">
326 <a
class=
"btn btn-default " href=
"http://www.github.com" aria-label=
"next" data-action=
"http://www.github.com" id=
"id_2">
327 <span
class=
"glyphicon glyphicon-chevron-right"></span>
331 <div
class=
"panel-body">
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_with_sortation()
PanelSecondaryLegacyTest::test_render_with_sortation |
( |
| ) |
|
Definition at line 214 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
216 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
217 $sort_options = array(
221 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options);
222 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
223 ->withViewControls([$sortation]);
227 $expected_html = <<<EOT
228 <div
class=
"panel panel-secondary panel-flex">
229 <div
class=
"panel-heading ilHeader">
231 <div
class=
"il-viewcontrol-sortation" id=
"id_1">
232 <div
class=
"dropdown">
233 <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">
234 <span
class=
"caret"></span>
236 <ul
id=
"id_4_menu" class=
"dropdown-menu">
237 <li><button
class=
"btn btn-link" data-action=
"?sortation=a" id=
"id_2">
A</button></li>
238 <li><button
class=
"btn btn-link" data-action=
"?sortation=b" id=
"id_3">
B</button></li>
243 <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=[])
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_with_actions()
PanelSecondaryLegacyTest::test_with_actions |
( |
| ) |
|
Definition at line 104 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
106 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
107 $actions = $this->
getUIFactory()->dropdown()->standard(array(
108 $this->
getUIFactory()->button()->shy(
"ILIAS",
"https://www.ilias.de"),
109 $this->
getUIFactory()->button()->shy(
"Github",
"https://www.github.com")
112 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
113 ->withActions($actions);
115 $this->assertEquals($secondary_panel->getActions(), $actions);
◆ test_with_pagination_viewcontrol()
PanelSecondaryLegacyTest::test_with_pagination_viewcontrol |
( |
| ) |
|
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);
◆ test_with_section_viewcontrol()
PanelSecondaryLegacyTest::test_with_section_viewcontrol |
( |
| ) |
|
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);
◆ test_with_sortation_viewcontrol()
PanelSecondaryLegacyTest::test_with_sortation_viewcontrol |
( |
| ) |
|
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);
◆ test_without_viewcontrols()
PanelSecondaryLegacyTest::test_without_viewcontrols |
( |
| ) |
|
The documentation for this class was generated from the following file: