Test secondary listing panels.
More...
Test secondary listing panels.
Definition at line 31 of file PanelSecondaryListingTest.php.
◆ cleanHTML()
PanelSecondaryListingTest::cleanHTML |
( |
string |
$html | ) |
|
|
protected |
◆ getUIFactory()
PanelSecondaryListingTest::getUIFactory |
( |
| ) |
|
Definition at line 33 of file PanelSecondaryListingTest.php.
References ILIAS\Repository\button(), and ILIAS\Repository\symbol().
Referenced by testGetItemGroups(), testGetTitle(), testImplementsFactoryInterface(), testRenderWithActions(), testRenderWithFooter(), testRenderWithNoHeaderButContent(), testRenderWithNoHeaderNoContentNoFooter(), testRenderWithPagination(), testRenderWithSection(), testRenderWithSortation(), and testWithActions().
36 public function panelSecondary():
I\
Component\Panel\Secondary\Factory
38 return new I\Component\Panel\Secondary\Factory();
41 public function dropdown():
I\
Component\Dropdown\Factory
43 return new I\Component\Dropdown\Factory();
53 return new I\Component\Button\Factory();
58 return new I\Component\Symbol\Factory(
button(string $caption, string $cmd)
◆ testGetItemGroups()
PanelSecondaryListingTest::testGetItemGroups |
( |
| ) |
|
◆ testGetTitle()
PanelSecondaryListingTest::testGetTitle |
( |
| ) |
|
◆ testImplementsFactoryInterface()
PanelSecondaryListingTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testRenderWithActions()
PanelSecondaryListingTest::testRenderWithActions |
( |
| ) |
|
Definition at line 141 of file PanelSecondaryListingTest.php.
References ILIAS\Repository\button(), and getUIFactory().
143 $actions = $this->
getUIFactory()->dropdown()->standard(array(
148 $sec = $this->
getUIFactory()->panelSecondary()->listing(
"Title", array())->withActions($actions);
150 $html = $this->getDefaultRenderer()->render($sec);
152 $expected_html = <<<EOT
153 <div
class=
"panel panel-secondary panel-flex">
154 <div
class=
"panel-heading ilHeader">
155 <div
class=
"panel-title"><h2>
Title</h2></div>
156 <div
class=
"panel-controls">
157 <div
class=
"dropdown" id=
"id_3"><
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu"><span
class=
"caret"></span></
button>
158 <ul
id=
"id_3_menu" class=
"dropdown-menu">
159 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
160 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">Github</button></li>
165 <div
class=
"panel-body">
170 $this->brutallyTrimHTML($expected_html),
171 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
◆ testRenderWithFooter()
PanelSecondaryListingTest::testRenderWithFooter |
( |
| ) |
|
Definition at line 296 of file PanelSecondaryListingTest.php.
References ILIAS\Repository\button(), and getUIFactory().
298 $footer_shy_button = $this->
getUIFactory()->button()->shy(
"Action",
"");
299 $secondary_panel = $this->
getUIFactory()->panelSecondary()->listing(
"", array())->withFooter($footer_shy_button);
301 $html = $this->getDefaultRenderer()->render($secondary_panel);
303 $expected_html = <<<EOT
304 <div
class=
"panel panel-secondary panel-flex">\n
305 <div
class=
"panel-body"></div>\n
306 <div
class=
"panel-footer ilBlockInfo"><
button class=
"btn btn-link" data-action=
"">
Action</
button></div>\n
310 $this->assertHTMLEquals(
311 $this->brutallyTrimHTML($expected_html),
312 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderWithNoHeaderButContent()
PanelSecondaryListingTest::testRenderWithNoHeaderButContent |
( |
| ) |
|
Definition at line 316 of file PanelSecondaryListingTest.php.
References getUIFactory(), and ILIAS\ILIASObject\Creation\Group.
325 $secondary_panel = $this->
getUIFactory()->panelSecondary()->listing(
"", array($group));
327 $html = $this->getDefaultRenderer()->render($secondary_panel);
329 $expected_html = <<<EOT
330 <div
class=
"panel panel-secondary panel-flex">
331 <div
class=
"panel-body">
332 <div
class=
"il-item-group">
334 <div
class=
"il-item-group-items">
336 <li
class=
"il-std-item-container">
337 <div
class=
"il-item il-std-item ">
338 <h4
class=
"il-item-title">title1</h4>
341 <li
class=
"il-std-item-container">
342 <div
class=
"il-item il-std-item ">
343 <h4
class=
"il-item-title">title2</h4>
352 $this->assertHTMLEquals(
353 $this->brutallyTrimHTML($expected_html),
354 $this->brutallyTrimHTML($html)
◆ testRenderWithNoHeaderNoContentNoFooter()
PanelSecondaryListingTest::testRenderWithNoHeaderNoContentNoFooter |
( |
| ) |
|
◆ testRenderWithPagination()
PanelSecondaryListingTest::testRenderWithPagination |
( |
| ) |
|
Definition at line 215 of file PanelSecondaryListingTest.php.
References ILIAS\Repository\button(), and getUIFactory().
217 $pagination = $this->
getUIFactory()->viewControl()->pagination()
218 ->withTargetURL(
'http://ilias.de',
'page')
219 ->withTotalEntries(10)
221 ->withCurrentPage(1);
223 $sec = $this->
getUIFactory()->panelSecondary()->listing(
"Title", array())
224 ->withViewControls([$pagination]);
226 $html = $this->getDefaultRenderer()->render($sec);
228 $expected_html = <<<EOT
229 <div
class=
"panel panel-secondary panel-flex">
230 <div
class=
"panel-heading ilHeader">
231 <div
class=
"panel-title"><h2>
Title</h2></div>
232 <div
class=
"panel-viewcontrols l-bar__space-keeper">
233 <div
class=
"il-viewcontrol-pagination l-bar__element">
234 <
button class=
"btn btn-default" data-action=
"http://ilias.de?page=0" id=
"id_6">
235 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
237 <
button class=
"btn btn-link" data-action=
"http://ilias.de?page=0" id=
"id_1">1</button>
238 <button
class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"http://ilias.de?page=1" id=
"id_2">2</button>
239 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=2" id=
"id_3">3</button>
240 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=3" id=
"id_4">4</button>
241 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=4" id=
"id_5">5</button>
242 <button
class=
"btn btn-default" data-action=
"http://ilias.de?page=2" id=
"id_7">
243 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
247 <div
class=
"panel-controls"></div>
249 <div
class=
"panel-body"></div>
253 $this->brutallyTrimHTML($expected_html),
254 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderWithSection()
PanelSecondaryListingTest::testRenderWithSection |
( |
| ) |
|
Definition at line 258 of file PanelSecondaryListingTest.php.
References ILIAS\Repository\button(), and getUIFactory().
260 $back = $this->
getUIFactory()->button()->standard(
"previous",
"http://www.ilias.de");
261 $next = $this->
getUIFactory()->button()->standard(
"next",
"http://www.github.com");
262 $current = $this->
getUIFactory()->button()->standard(
"current",
"");
263 $section = $this->
getUIFactory()->viewControl()->section($back, $current, $next);
265 $secondary_panel = $this->
getUIFactory()->panelSecondary()->listing(
"Title", array())
266 ->withViewControls([$section]);
268 $html = $this->getDefaultRenderer()->render($secondary_panel);
270 $expected_html = <<<EOT
271 <div
class=
"panel panel-secondary panel-flex">
272 <div
class=
"panel-heading ilHeader">
273 <div
class=
"panel-title"><h2>
Title</h2></div>
274 <div
class=
"panel-viewcontrols l-bar__space-keeper">
275 <div
class=
"il-viewcontrol-section l-bar__element">
276 <a
class=
"btn btn-ctrl browse previous" href=
"http://www.ilias.de" aria-label=
"previous" data-action=
"http://www.ilias.de" id=
"id_1">
277 <span
class=
"glyphicon glyphicon-chevron-left"></span>
279 <
button class=
"btn btn-default" data-action=
"">current</button>
280 <a
class=
"btn btn-ctrl browse next" href=
"http://www.github.com" aria-label=
"next" data-action=
"http://www.github.com" id=
"id_2">
281 <span
class=
"glyphicon glyphicon-chevron-right"></span>
285 <div
class=
"panel-controls"></div>
287 <div
class=
"panel-body">
292 $this->brutallyTrimHTML($expected_html),
293 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderWithSortation()
PanelSecondaryListingTest::testRenderWithSortation |
( |
| ) |
|
Definition at line 175 of file PanelSecondaryListingTest.php.
References ILIAS\Repository\button(), and getUIFactory().
177 $sort_options = array(
181 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'a');
182 $sec = $this->
getUIFactory()->panelSecondary()->listing(
"Title", array())
183 ->withViewControls([$sortation]);
185 $html = $this->getDefaultRenderer()->render($sec);
187 $expected_html = <<<EOT
188 <div
class=
"panel panel-secondary panel-flex">
189 <div
class=
"panel-heading ilHeader">
190 <div
class=
"panel-title"><h2>
Title</h2></div>
191 <div
class=
"panel-viewcontrols l-bar__space-keeper">
192 <div
class=
"dropdown il-viewcontrol il-viewcontrol-sortation l-bar__element" id=
"id_1">
193 <
button class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-label=
"sortation" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_1_ctrl">
194 <span
class=
"label">vc_sort
A</span>
195 <span
class=
"glyphicon-sort"></span>
197 <ul
id=
"id_1_ctrl" class=
"dropdown-menu">
198 <li
class=
"selected"><
button class=
"btn btn-link" data-action=
"?sortation=a" id=
"id_2">
A</
button></li>
199 <li><
button class=
"btn btn-link" data-action=
"?sortation=b" id=
"id_3">
B</button></li>
203 <div
class=
"panel-controls"></div>
205 <div
class=
"panel-body">
210 $this->brutallyTrimHTML($expected_html),
211 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testWithActions()
PanelSecondaryListingTest::testWithActions |
( |
| ) |
|
The documentation for this class was generated from the following file: