Test secondary legacy panels.
More...
Test secondary legacy panels.
Definition at line 15 of file PanelSecondaryLegacyTest.php.
◆ cleanHTML()
PanelSecondaryLegacyTest::cleanHTML |
( |
|
$html | ) |
|
|
protected |
◆ getUIFactory()
PanelSecondaryLegacyTest::getUIFactory |
( |
| ) |
|
Definition at line 17 of file PanelSecondaryLegacyTest.php.
References Vendor\Package\$f, $factory, and 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().
20 public function legacyPanel($title, $content)
22 return new I\Component\Panel\Secondary\Legacy($title, $content);
24 public function legacy($content)
27 return $f->legacy($content);
29 public function dropdown()
31 return new I\Component\Dropdown\Factory();
33 public function viewControl()
37 public function button()
39 return new I\Component\Button\Factory();
41 public function symbol() :
C\Symbol\Factory
43 return new I\Component\Symbol\Factory(
◆ 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 160 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
162 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
163 $actions = $this->
getUIFactory()->dropdown()->standard(array(
164 $this->
getUIFactory()->button()->shy(
"ILIAS",
"https://www.ilias.de"),
165 $this->
getUIFactory()->button()->shy(
"Github",
"https://www.github.com")
168 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)->withActions($actions);
172 $expected_html = <<<EOT
173 <div
class=
"panel panel-secondary panel-flex">
174 <div
class=
"panel-heading ilHeader">
176 <div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false"> <span
class=
"caret"></span></button>
177 <ul
class=
"dropdown-menu">
178 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
179 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">Github</button></li>
183 <div
class=
"panel-body">
Class ChatMainBarProvider .
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_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 234 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), disabled(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
236 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
238 $pagination = $this->
getUIFactory()->viewControl()->pagination()
239 ->withTargetURL(
'http://ilias.de',
'page')
240 ->withTotalEntries(10)
242 ->withCurrentPage(1);
244 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
245 ->withViewControls([$pagination]);
249 $expected_html = <<<EOT
250 <div
class=
"panel panel-secondary panel-flex">
251 <div
class=
"panel-heading ilHeader">
253 <div
class=
"il-viewcontrol-pagination">
254 <span
class=
"browse previous">
255 <a
class=
"glyph" href=
"http://ilias.de?page=0" aria-label=
"back">
256 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
259 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=0" id=
"id_1">1</button>
260 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=1" disabled=
"true">2</button>
261 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=2" id=
"id_2">3</button>
262 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=3" id=
"id_3">4</button>
263 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=4" id=
"id_4">5</button>
264 <span
class=
"browse next">
265 <a
class=
"glyph" href=
"http://ilias.de?page=2" aria-label=
"next">
266 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
271 <div
class=
"panel-body">
getDefaultRenderer(JavaScriptBinding $js_binding=null)
disabled()
Example showing how to plug a disabled checkbox into a form.
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_with_section()
PanelSecondaryLegacyTest::test_render_with_section |
( |
| ) |
|
Definition at line 282 of file PanelSecondaryLegacyTest.php.
References $section, ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
284 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
285 $back = $this->
getUIFactory()->button()->standard(
"previous",
"http://www.ilias.de");
286 $next = $this->
getUIFactory()->button()->standard(
"next",
"http://www.github.com");
287 $current = $this->
getUIFactory()->button()->standard(
"current",
"");
290 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
295 $expected_html = <<<EOT
296 <div
class=
"panel panel-secondary panel-flex">
297 <div
class=
"panel-heading ilHeader">
299 <div
class=
"il-viewcontrol-section">
300 <a
class=
"btn btn-default " href=
"http://www.ilias.de" aria-label=
"previous" data-action=
"http://www.ilias.de">
301 <span
class=
"glyphicon glyphicon-chevron-left"></span>
303 <button
class=
"btn btn-default" data-action=
"">
306 <a
class=
"btn btn-default " href=
"http://www.github.com" aria-label=
"next" data-action=
"http://www.github.com">
307 <span
class=
"glyphicon glyphicon-chevron-right"></span>
311 <div
class=
"panel-body">
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_with_sortation()
PanelSecondaryLegacyTest::test_render_with_sortation |
( |
| ) |
|
Definition at line 194 of file PanelSecondaryLegacyTest.php.
References ILIAS_UI_TestBase\assertHTMLEquals(), cleanHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().
196 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
197 $sort_options = array(
201 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options);
202 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
203 ->withViewControls([$sortation]);
207 $expected_html = <<<EOT
208 <div
class=
"panel panel-secondary panel-flex">
209 <div
class=
"panel-heading ilHeader">
211 <div
class=
"il-viewcontrol-sortation" id=
"">
212 <div
class=
"dropdown">
213 <button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false">
214 <span
class=
"caret"></span>
216 <ul
class=
"dropdown-menu">
217 <li><button
class=
"btn btn-link" data-action=
"?sortation=a" id=
"id_1">
A</button></li>
218 <li><button
class=
"btn btn-link" data-action=
"?sortation=b" id=
"id_2">
B</button></li>
223 <div
class=
"panel-body">
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_with_actions()
PanelSecondaryLegacyTest::test_with_actions |
( |
| ) |
|
Definition at line 84 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
86 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
87 $actions = $this->
getUIFactory()->dropdown()->standard(array(
88 $this->
getUIFactory()->button()->shy(
"ILIAS",
"https://www.ilias.de"),
89 $this->
getUIFactory()->button()->shy(
"Github",
"https://www.github.com")
92 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
93 ->withActions($actions);
95 $this->assertEquals($secondary_panel->getActions(), $actions);
◆ test_with_pagination_viewcontrol()
PanelSecondaryLegacyTest::test_with_pagination_viewcontrol |
( |
| ) |
|
Definition at line 125 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
127 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
128 $pagination = $this->
getUIFactory()->viewControl()->pagination()
129 ->withTargetURL(
"http://ilias.de",
'page')
130 ->withTotalEntries(98)
132 ->withCurrentPage(1);
134 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
135 ->withViewControls([$pagination]);
137 $array_vc = $secondary_panel->getViewControls();
139 $this->assertEquals($array_vc[0], $pagination);
◆ test_with_section_viewcontrol()
PanelSecondaryLegacyTest::test_with_section_viewcontrol |
( |
| ) |
|
◆ test_with_sortation_viewcontrol()
PanelSecondaryLegacyTest::test_with_sortation_viewcontrol |
( |
| ) |
|
Definition at line 107 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
109 $legacy = $this->
getUIFactory()->legacy(
"Legacy content");
110 $sort_options = array(
111 'internal_rating' =>
'Best',
112 'date_desc' =>
'Most Recent',
113 'date_asc' =>
'Oldest',
115 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options);
117 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
118 ->withViewControls([$sortation]);
120 $array_vc = $secondary_panel->getViewControls();
122 $this->assertEquals($array_vc[0], $sortation);
◆ test_without_viewcontrols()
PanelSecondaryLegacyTest::test_without_viewcontrols |
( |
| ) |
|
The documentation for this class was generated from the following file: