Test on button implementation.
More...
Test on button implementation.
Definition at line 45 of file PanelTest.php.
◆ getPanelFactory()
| PanelTest::getPanelFactory |
( |
| ) |
|
Definition at line 77 of file PanelTest.php.
77 : I\Component\Panel\Factory
79 return new I\Component\Panel\Factory(
80 $this->createMock(
C\Panel\Listing\Factory::class)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ getUIFactory()
| PanelTest::getUIFactory |
( |
| ) |
|
Definition at line 47 of file PanelTest.php.
References ILIAS\Repository\button(), and ILIAS\Repository\symbol().
50 public function panelSecondary():
I\
Component\Panel\Secondary\Factory
52 return new I\Component\Panel\Secondary\Factory();
54 public function dropdown():
I\
Component\Dropdown\Factory
56 return new I\Component\Dropdown\Factory();
64 return new I\Component\Button\Factory();
66 public function symbol():
C\Symbol\Factory
68 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...
◆ testImplementsFactoryInterface()
| PanelTest::testImplementsFactoryInterface |
( |
| ) |
|
Definition at line 84 of file PanelTest.php.
References Vendor\Package\$f.
88 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Panel\\Factory",
$f);
89 $this->assertInstanceOf(
90 "ILIAS\\UI\\Component\\Panel\\Standard",
93 $this->assertInstanceOf(
94 "ILIAS\\UI\\Component\\Panel\\Sub",
97 $this->assertInstanceOf(
98 "ILIAS\\UI\\Component\\Panel\\Report",
◆ testRenderReport()
| PanelTest::testRenderReport |
( |
| ) |
|
Definition at line 332 of file PanelTest.php.
References $r, and ILIAS\Repository\button().
335 $r = $this->getDefaultRenderer();
337 $actions =
new I\Component\Dropdown\Standard(array(
342 $sub = $fp->sub(
"Title", array());
343 $card =
new I\Component\Card\Card(
"Card Title");
344 $sub = $sub->withFurtherInformation($card);
345 $report = $fp->report(
"Title", $sub)->withActions($actions);
347 $html = $this->brutallyTrimHTML(
$r->render($report));
349 $expected_html = <<<EOT
350 <div
class=
"panel panel-primary il-panel-report panel-flex">
351 <div
class=
"panel-heading ilHeader">
352 <div
class=
"panel-title"><h2>
Title</h2></div>
353 <div
class=
"panel-controls">
354 <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>
355 <ul
id=
"id_3_menu" class=
"dropdown-menu">
356 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
357 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
362 <div
class=
"panel-body">
363 <div
class=
"panel panel-sub panel-flex">
364 <div
class=
"panel-heading ilBlockHeader">
366 <div
class=
"panel-controls"></div>
368 <div
class=
"panel-body"><div
class=
"row">
369 <div
class=
"col-sm-8"></div>
370 <div
class=
"col-sm-4">
371 <div
class=
"il-card thumbnail">
372 <div
class=
"card-no-highlight"></div>
373 <div
class=
"caption card-title">
Card Title</div>
383 $this->assertHTMLEquals($this->brutallyTrimHTML($expected_html), $html);
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testRenderReportWithMode()
| PanelTest::testRenderReportWithMode |
( |
| ) |
|
Definition at line 416 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
422 $mode = $this->
getUIFactory()->viewControl()->mode($modes,
'Presentation Mode');
425 $r = $this->getDefaultRenderer();
428 $p =
$f->report(
"Title", [])
429 ->withViewControls([$mode]);
431 $html =
$r->render($p);
433 $expected_html = <<<EOT
434 <div
class=
"panel panel-primary il-panel-report panel-flex">
435 <div
class=
"panel-heading ilHeader">
436 <div
class=
"panel-title"><h2>
Title</h2></div>
437 <div
class=
"panel-viewcontrols l-bar__space-keeper">
438 <div
class=
"il-viewcontrol-mode l-bar__element" aria-label=
"Presentation Mode" role=
"group">
439 <
button class=
"btn btn-default engaged" aria-pressed=
"true" data-action=
"a" id=
"id_1">
A</
button>
440 <
button class=
"btn btn-default" aria-pressed=
"false" data-action=
"b" id=
"id_2">
B</button>
443 <div
class=
"panel-controls"></div>
445 <div
class=
"panel-body"></div>
449 $this->brutallyTrimHTML($expected_html),
450 $this->brutallyTrimHTML($html)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
button(string $caption, string $cmd)
◆ testRenderStandard()
| PanelTest::testRenderStandard |
( |
| ) |
|
Definition at line 213 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
216 $r = $this->getDefaultRenderer();
218 $actions =
new I\Component\Dropdown\Standard(array(
223 $p =
$f->standard(
"Title", array())->withActions($actions);
225 $html =
$r->render($p);
227 $expected_html = <<<EOT
228 <div
class=
"panel panel-primary panel-flex">
229 <div
class=
"panel-heading ilHeader">
230 <div
class=
"panel-title"><h2>
Title</h2></div>
231 <div
class=
"panel-controls">
232 <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>
233 <ul
id=
"id_3_menu" class=
"dropdown-menu">
234 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
235 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
240 <div
class=
"panel-body"></div>
243 $this->assertHTMLEquals($expected_html, $html);
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testRenderSub()
| PanelTest::testRenderSub |
( |
| ) |
|
Definition at line 246 of file PanelTest.php.
References $r, and ILIAS\Repository\button().
249 $r = $this->getDefaultRenderer();
251 $actions =
new I\Component\Dropdown\Standard(array(
256 $p = $fp->sub(
"Title", array())->withActions($actions);
257 $card =
new I\Component\Card\Card(
"Card Title");
259 $p = $p->withFurtherInformation($card);
260 $html = $this->brutallyTrimHTML(
$r->render($p));
262 $expected_html = <<<EOT
263 <div
class=
"panel panel-sub panel-flex">
264 <div
class=
"panel-heading ilBlockHeader">
266 <div
class=
"panel-controls">
267 <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>
268 <ul
id=
"id_3_menu" class=
"dropdown-menu">
269 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
270 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
275 <div
class=
"panel-body">
277 <div
class=
"col-sm-8"></div>
278 <div
class=
"col-sm-4">
279 <div
class=
"il-card thumbnail">
280 <div
class=
"card-no-highlight"></div>
281 <div
class=
"caption card-title">
Card Title</div>
289 $this->assertHTMLEquals($this->brutallyTrimHTML($expected_html), $html);
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testRenderSubWithSecondaryPanel()
| PanelTest::testRenderSubWithSecondaryPanel |
( |
| ) |
|
Definition at line 292 of file PanelTest.php.
References $r.
295 $r = $this->getDefaultRenderer();
297 $p = $fp->sub(
"Title", array());
298 $legacy =
new I\Component\Legacy\Legacy(
"Legacy content",
new SignalGenerator());
299 $secondary =
new I\Component\Panel\Secondary\Legacy(
"Legacy panel title", $legacy);
300 $p = $p->withFurtherInformation($secondary);
301 $html =
$r->render($p);
303 $expected_html = <<<EOT
304 <div
class=
"panel panel-sub panel-flex">
305 <div
class=
"panel-heading ilBlockHeader">
307 <div
class=
"panel-controls"></div>
309 <div
class=
"panel-body">
311 <div
class=
"col-sm-8"></div>
312 <div
class=
"col-sm-4">
313 <div
class=
"panel panel-secondary panel-flex">
314 <div
class=
"panel-heading ilHeader">
315 <div
class=
"panel-title"><h2>Legacy panel title</h2></div>
316 <div
class=
"panel-controls"></div>
318 <div
class=
"panel-body">Legacy content</div>
326 $this->assertHTMLEquals(
327 $this->brutallyTrimHTML($expected_html),
328 $this->brutallyTrimHTML($html)
◆ testRenderWithPagination()
| PanelTest::testRenderWithPagination |
( |
| ) |
|
Definition at line 499 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
501 $pagination = $this->
getUIFactory()->viewControl()->pagination()
502 ->withTargetURL(
'http://ilias.de',
'page')
503 ->withTotalEntries(10)
505 ->withCurrentPage(1);
508 $r = $this->getDefaultRenderer();
511 $p =
$f->standard(
"Title", [])
512 ->withViewControls([$pagination]);
514 $html =
$r->render($p);
516 $expected_html = <<<EOT
517 <div
class=
"panel panel-primary panel-flex">
518 <div
class=
"panel-heading ilHeader">
519 <div
class=
"panel-title"><h2>
Title</h2></div>
520 <div
class=
"panel-viewcontrols l-bar__space-keeper">
521 <div
class=
"il-viewcontrol-pagination l-bar__element">
522 <
button class=
"btn btn-default" data-action=
"http://ilias.de?page=0" id=
"id_6">
523 <span
class=
"glyph" aria-label=
"back" role=
"img"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></span>
525 <
button class=
"btn btn-link" data-action=
"http://ilias.de?page=0" id=
"id_1">1</button>
526 <button
class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"http://ilias.de?page=1" id=
"id_2">2</button>
527 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=2" id=
"id_3">3</button>
528 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=3" id=
"id_4">4</button>
529 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=4" id=
"id_5">5</button>
530 <button
class=
"btn btn-default" data-action=
"http://ilias.de?page=2" id=
"id_7">
531 <span
class=
"glyph" aria-label=
"next" role=
"img"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></span>
535 <div
class=
"panel-controls"></div>
537 <div
class=
"panel-body"></div>
541 $this->brutallyTrimHTML($expected_html),
542 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderWithSortation()
| PanelTest::testRenderWithSortation |
( |
| ) |
|
Definition at line 454 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
461 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'b');
464 $r = $this->getDefaultRenderer();
467 $p =
$f->standard(
"Title", [])
468 ->withViewControls([$sortation]);
470 $html =
$r->render($p);
472 $expected_html = <<<EOT
473 <div
class=
"panel panel-primary panel-flex">
474 <div
class=
"panel-heading ilHeader">
475 <div
class=
"panel-title"><h2>
Title</h2></div>
476 <div
class=
"panel-viewcontrols l-bar__space-keeper">
477 <div
class=
"dropdown il-viewcontrol il-viewcontrol-sortation l-bar__element" id=
"id_1">
478 <
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">
479 <span
class=
"label">vc_sort
B</span>
480 <span
class=
"caret"></span>
482 <ul
id=
"id_1_ctrl" class=
"dropdown-menu">
483 <li><
button class=
"btn btn-link" data-action=
"?sortation=a" id=
"id_2">
A</button></li>
484 <li
class=
"selected"><button
class=
"btn btn-link" data-action=
"?sortation=b" id=
"id_3">
B</button></li>
488 <div
class=
"panel-controls"></div>
490 <div
class=
"panel-body"></div>
494 $this->brutallyTrimHTML($expected_html),
495 $this->brutallyTrimHTML($html)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
button(string $caption, string $cmd)
◆ testReportGetContent()
| PanelTest::testReportGetContent |
( |
| ) |
|
◆ testReportGetTitle()
| PanelTest::testReportGetTitle |
( |
| ) |
|
◆ testReportWithActions()
| PanelTest::testReportWithActions |
( |
| ) |
|
Definition at line 179 of file PanelTest.php.
183 $p = $fp->report(
"Title", $fp->sub(
"Title", array(
new ComponentDummy())));
185 $actions =
new I\Component\Dropdown\Standard(array(
190 $p = $p->withActions($actions);
192 $this->assertEquals($p->getActions(), $actions);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testReportWithViewControls()
| PanelTest::testReportWithViewControls |
( |
| ) |
|
Definition at line 401 of file PanelTest.php.
References Vendor\Package\$f.
407 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'a');
409 $p =
$f->report(
"Title", [])
410 ->withViewControls([$sortation])
413 $this->assertEquals($p->getViewControls(), [$sortation]);
◆ testStandardGetContent()
| PanelTest::testStandardGetContent |
( |
| ) |
|
◆ testStandardGetTitle()
| PanelTest::testStandardGetTitle |
( |
| ) |
|
◆ testStandardWithActions()
| PanelTest::testStandardWithActions |
( |
| ) |
|
Definition at line 120 of file PanelTest.php.
126 $actions =
new I\Component\Dropdown\Standard(array(
131 $p = $p->withActions($actions);
133 $this->assertEquals($p->getActions(), $actions);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testStandardWithViewControls()
| PanelTest::testStandardWithViewControls |
( |
| ) |
|
Definition at line 386 of file PanelTest.php.
References Vendor\Package\$f.
392 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'a');
394 $p =
$f->standard(
"Title", [])
395 ->withViewControls([$sortation])
398 $this->assertEquals($p->getViewControls(), [$sortation]);
◆ testSubWithActions()
| PanelTest::testSubWithActions |
( |
| ) |
|
Definition at line 136 of file PanelTest.php.
142 $actions =
new I\Component\Dropdown\Standard(array(
147 $p = $p->withActions($actions);
149 $this->assertEquals($p->getActions(), $actions);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testSubWithCard()
| PanelTest::testSubWithCard |
( |
| ) |
|
Definition at line 152 of file PanelTest.php.
158 $card =
new I\Component\Card\Card(
"Card Title");
160 $p = $p->withFurtherInformation($card);
162 $this->assertEquals($p->getFurtherInformation(), $card);
◆ testSubWithSecondaryPanel()
| PanelTest::testSubWithSecondaryPanel |
( |
| ) |
|
Definition at line 165 of file PanelTest.php.
171 $legacy =
new I\Component\Legacy\Legacy(
"Legacy content",
new SignalGenerator());
172 $secondary =
new I\Component\Panel\Secondary\Legacy(
"Legacy panel title", $legacy);
174 $p = $p->withFurtherInformation($secondary);
176 $this->assertEquals($p->getFurtherInformation(), $secondary);
The documentation for this class was generated from the following file: