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(
I\
Component\Panel\Listing\Factory::class),
81 $this->createMock(
I\
Component\Panel\Secondary\Factory::class),
◆ 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();
68 return new I\Component\Symbol\Factory(
button(string $caption, string $cmd)
◆ testImplementsFactoryInterface()
PanelTest::testImplementsFactoryInterface |
( |
| ) |
|
Definition at line 85 of file PanelTest.php.
References Vendor\Package\$f.
89 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Panel\\Factory",
$f);
90 $this->assertInstanceOf(
91 "ILIAS\\UI\\Component\\Panel\\Standard",
94 $this->assertInstanceOf(
95 "ILIAS\\UI\\Component\\Panel\\Sub",
98 $this->assertInstanceOf(
99 "ILIAS\\UI\\Component\\Panel\\Report",
◆ testRenderReport()
PanelTest::testRenderReport |
( |
| ) |
|
Definition at line 333 of file PanelTest.php.
References $r, and ILIAS\Repository\button().
336 $r = $this->getDefaultRenderer();
338 $actions =
new I\Component\Dropdown\Standard(array(
343 $sub = $fp->sub(
"Title", array());
344 $card =
new I\Component\Card\Card(
"Card Title");
345 $sub = $sub->withFurtherInformation($card);
346 $report = $fp->report(
"Title", $sub)->withActions($actions);
348 $html = $this->brutallyTrimHTML(
$r->render($report));
350 $expected_html = <<<EOT
351 <div
class=
"panel panel-primary il-panel-report panel-flex">
352 <div
class=
"panel-heading ilHeader">
353 <div
class=
"panel-title"><h2>
Title</h2></div>
354 <div
class=
"panel-controls">
355 <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>
356 <ul
id=
"id_3_menu" class=
"dropdown-menu">
357 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
358 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
363 <div
class=
"panel-body">
364 <div
class=
"panel panel-sub panel-flex">
365 <div
class=
"panel-heading ilBlockHeader">
367 <div
class=
"panel-controls"></div>
369 <div
class=
"panel-body"><div
class=
"row">
370 <div
class=
"col-sm-8"></div>
371 <div
class=
"col-sm-4">
372 <div
class=
"il-card thumbnail">
373 <div
class=
"card-no-highlight"></div>
374 <div
class=
"caption card-title">
Card Title</div>
384 $this->assertHTMLEquals($this->brutallyTrimHTML($expected_html), $html);
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
◆ testRenderReportWithMode()
PanelTest::testRenderReportWithMode |
( |
| ) |
|
Definition at line 417 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
423 $mode = $this->
getUIFactory()->viewControl()->mode($modes,
'Presentation Mode');
426 $r = $this->getDefaultRenderer();
429 $p =
$f->report(
"Title", [])
430 ->withViewControls([$mode]);
432 $html =
$r->render($p);
434 $expected_html = <<<EOT
435 <div
class=
"panel panel-primary il-panel-report panel-flex">
436 <div
class=
"panel-heading ilHeader">
437 <div
class=
"panel-title"><h2>
Title</h2></div>
438 <div
class=
"panel-viewcontrols l-bar__space-keeper">
439 <div
class=
"il-viewcontrol-mode l-bar__element" aria-label=
"Presentation Mode" role=
"group">
440 <
button class=
"btn btn-default engaged" aria-pressed=
"true" data-action=
"a" id=
"id_1">
A</
button>
441 <
button class=
"btn btn-default" aria-pressed=
"false" data-action=
"b" id=
"id_2">
B</button>
444 <div
class=
"panel-controls"></div>
446 <div
class=
"panel-body"></div>
450 $this->brutallyTrimHTML($expected_html),
451 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderStandard()
PanelTest::testRenderStandard |
( |
| ) |
|
Definition at line 214 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
217 $r = $this->getDefaultRenderer();
219 $actions =
new I\Component\Dropdown\Standard(array(
224 $p =
$f->standard(
"Title", array())->withActions($actions);
226 $html =
$r->render($p);
228 $expected_html = <<<EOT
229 <div
class=
"panel panel-primary panel-flex">
230 <div
class=
"panel-heading ilHeader">
231 <div
class=
"panel-title"><h2>
Title</h2></div>
232 <div
class=
"panel-controls">
233 <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>
234 <ul
id=
"id_3_menu" class=
"dropdown-menu">
235 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
236 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
241 <div
class=
"panel-body"></div>
244 $this->assertHTMLEquals($expected_html, $html);
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
◆ testRenderSub()
PanelTest::testRenderSub |
( |
| ) |
|
Definition at line 247 of file PanelTest.php.
References $r, and ILIAS\Repository\button().
250 $r = $this->getDefaultRenderer();
252 $actions =
new I\Component\Dropdown\Standard(array(
257 $p = $fp->sub(
"Title", array())->withActions($actions);
258 $card =
new I\Component\Card\Card(
"Card Title");
260 $p = $p->withFurtherInformation($card);
261 $html = $this->brutallyTrimHTML(
$r->render($p));
263 $expected_html = <<<EOT
264 <div
class=
"panel panel-sub panel-flex">
265 <div
class=
"panel-heading ilBlockHeader">
267 <div
class=
"panel-controls">
268 <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>
269 <ul
id=
"id_3_menu" class=
"dropdown-menu">
270 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
271 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
276 <div
class=
"panel-body">
278 <div
class=
"col-sm-8"></div>
279 <div
class=
"col-sm-4">
280 <div
class=
"il-card thumbnail">
281 <div
class=
"card-no-highlight"></div>
282 <div
class=
"caption card-title">
Card Title</div>
290 $this->assertHTMLEquals($this->brutallyTrimHTML($expected_html), $html);
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
◆ testRenderSubWithSecondaryPanel()
PanelTest::testRenderSubWithSecondaryPanel |
( |
| ) |
|
Definition at line 293 of file PanelTest.php.
References $r.
296 $r = $this->getDefaultRenderer();
298 $p = $fp->sub(
"Title", array());
299 $legacy =
new I\Component\Legacy\Content(
"Legacy content",
new SignalGenerator());
300 $secondary =
new I\Component\Panel\Secondary\Legacy(
"Legacy panel title", $legacy);
301 $p = $p->withFurtherInformation($secondary);
302 $html =
$r->render($p);
304 $expected_html = <<<EOT
305 <div
class=
"panel panel-sub panel-flex">
306 <div
class=
"panel-heading ilBlockHeader">
308 <div
class=
"panel-controls"></div>
310 <div
class=
"panel-body">
312 <div
class=
"col-sm-8"></div>
313 <div
class=
"col-sm-4">
314 <div
class=
"panel panel-secondary panel-flex">
315 <div
class=
"panel-heading ilHeader">
316 <div
class=
"panel-title"><h2>Legacy panel title</h2></div>
317 <div
class=
"panel-controls"></div>
319 <div
class=
"panel-body">Legacy content</div>
327 $this->assertHTMLEquals(
328 $this->brutallyTrimHTML($expected_html),
329 $this->brutallyTrimHTML($html)
◆ testRenderWithPagination()
PanelTest::testRenderWithPagination |
( |
| ) |
|
Definition at line 500 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
502 $pagination = $this->
getUIFactory()->viewControl()->pagination()
503 ->withTargetURL(
'http://ilias.de',
'page')
504 ->withTotalEntries(10)
506 ->withCurrentPage(1);
509 $r = $this->getDefaultRenderer();
512 $p =
$f->standard(
"Title", [])
513 ->withViewControls([$pagination]);
515 $html =
$r->render($p);
517 $expected_html = <<<EOT
518 <div
class=
"panel panel-primary panel-flex">
519 <div
class=
"panel-heading ilHeader">
520 <div
class=
"panel-title"><h2>
Title</h2></div>
521 <div
class=
"panel-viewcontrols l-bar__space-keeper">
522 <div
class=
"il-viewcontrol-pagination l-bar__element">
523 <span
class=
"btn btn-ctrl browse previous">
524 <a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=0" aria-label=
"back">
525 <span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span>
528 <
button class=
"btn btn-link" data-action=
"http://ilias.de?page=0" id=
"id_1">1</button>
529 <button
class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"http://ilias.de?page=1" id=
"id_2">2</button>
530 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=2" id=
"id_3">3</button>
531 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=3" id=
"id_4">4</button>
532 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=4" id=
"id_5">5</button>
533 <span
class=
"btn btn-ctrl browse next">
534 <a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=2" aria-label=
"next">
535 <span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span>
540 <div
class=
"panel-controls"></div>
542 <div
class=
"panel-body"></div>
546 $this->brutallyTrimHTML($expected_html),
547 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testRenderWithSortation()
PanelTest::testRenderWithSortation |
( |
| ) |
|
Definition at line 455 of file PanelTest.php.
References Vendor\Package\$f, $r, and ILIAS\Repository\button().
462 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'b');
465 $r = $this->getDefaultRenderer();
468 $p =
$f->standard(
"Title", [])
469 ->withViewControls([$sortation]);
471 $html =
$r->render($p);
473 $expected_html = <<<EOT
474 <div
class=
"panel panel-primary panel-flex">
475 <div
class=
"panel-heading ilHeader">
476 <div
class=
"panel-title"><h2>
Title</h2></div>
477 <div
class=
"panel-viewcontrols l-bar__space-keeper">
478 <div
class=
"dropdown il-viewcontrol il-viewcontrol-sortation l-bar__element" id=
"id_1">
479 <
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">
480 <span
class=
"label">vc_sort
B</span>
481 <span
class=
"glyphicon-sort"></span>
483 <ul
id=
"id_1_ctrl" class=
"dropdown-menu">
484 <li><
button class=
"btn btn-link" data-action=
"?sortation=a" id=
"id_2">
A</button></li>
485 <li
class=
"selected"><button
class=
"btn btn-link" data-action=
"?sortation=b" id=
"id_3">
B</button></li>
489 <div
class=
"panel-controls"></div>
491 <div
class=
"panel-body"></div>
495 $this->brutallyTrimHTML($expected_html),
496 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ testReportGetContent()
PanelTest::testReportGetContent |
( |
| ) |
|
◆ testReportGetTitle()
PanelTest::testReportGetTitle |
( |
| ) |
|
◆ testReportWithActions()
PanelTest::testReportWithActions |
( |
| ) |
|
Definition at line 180 of file PanelTest.php.
184 $p = $fp->report(
"Title", $fp->sub(
"Title", array(
new ComponentDummy())));
186 $actions =
new I\Component\Dropdown\Standard(array(
191 $p = $p->withActions($actions);
193 $this->assertEquals($p->getActions(), $actions);
◆ testReportWithViewControls()
PanelTest::testReportWithViewControls |
( |
| ) |
|
Definition at line 402 of file PanelTest.php.
References Vendor\Package\$f.
408 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'a');
410 $p =
$f->report(
"Title", [])
411 ->withViewControls([$sortation])
414 $this->assertEquals($p->getViewControls(), [$sortation]);
◆ testStandardGetContent()
PanelTest::testStandardGetContent |
( |
| ) |
|
◆ testStandardGetTitle()
PanelTest::testStandardGetTitle |
( |
| ) |
|
◆ testStandardWithActions()
PanelTest::testStandardWithActions |
( |
| ) |
|
Definition at line 121 of file PanelTest.php.
127 $actions =
new I\Component\Dropdown\Standard(array(
132 $p = $p->withActions($actions);
134 $this->assertEquals($p->getActions(), $actions);
◆ testStandardWithViewControls()
PanelTest::testStandardWithViewControls |
( |
| ) |
|
Definition at line 387 of file PanelTest.php.
References Vendor\Package\$f.
393 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'a');
395 $p =
$f->standard(
"Title", [])
396 ->withViewControls([$sortation])
399 $this->assertEquals($p->getViewControls(), [$sortation]);
◆ testSubWithActions()
PanelTest::testSubWithActions |
( |
| ) |
|
Definition at line 137 of file PanelTest.php.
143 $actions =
new I\Component\Dropdown\Standard(array(
148 $p = $p->withActions($actions);
150 $this->assertEquals($p->getActions(), $actions);
◆ testSubWithCard()
PanelTest::testSubWithCard |
( |
| ) |
|
Definition at line 153 of file PanelTest.php.
159 $card =
new I\Component\Card\Card(
"Card Title");
161 $p = $p->withFurtherInformation($card);
163 $this->assertEquals($p->getFurtherInformation(), $card);
◆ testSubWithSecondaryPanel()
PanelTest::testSubWithSecondaryPanel |
( |
| ) |
|
Definition at line 166 of file PanelTest.php.
172 $legacy =
new I\Component\Legacy\Content(
"Legacy content",
new SignalGenerator());
173 $secondary =
new I\Component\Panel\Secondary\Legacy(
"Legacy panel title", $legacy);
175 $p = $p->withFurtherInformation($secondary);
177 $this->assertEquals($p->getFurtherInformation(), $secondary);
The documentation for this class was generated from the following file: