Test items.
More...
Test items.
Definition at line 33 of file ItemTest.php.
◆ getFactory()
Definition at line 35 of file ItemTest.php.
Referenced by test_get_title(), test_implements_factory_interface(), test_link_title(), test_render_audio_player(), test_render_base(), test_render_lead_icon(), test_render_lead_image(), test_render_lead_letter_avatar(), test_render_lead_picture_avatar(), test_render_lead_text_and_color(), test_render_progress(), test_render_progress_and_lead_icon(), test_render_progress_and_lead_image(), test_shy_title_and_various_properties(), test_with_actions(), test_with_audio_player(), test_with_color(), test_with_description(), test_with_lead_icon(), test_with_lead_image(), test_with_lead_letter_avatar(), test_with_lead_picture_avatar(), test_with_lead_text(), test_with_no_lead(), test_with_progress(), and test_with_properties().
37 return new I\Component\Item\Factory();
◆ test_get_title()
ItemTest::test_get_title |
( |
| ) |
|
◆ test_implements_factory_interface()
ItemTest::test_implements_factory_interface |
( |
| ) |
|
◆ test_link_title()
ItemTest::test_link_title |
( |
| ) |
|
Definition at line 577 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
583 $html = $r->render(
$c);
586 <div
class=
"il-item il-std-item "><div
class=
"il-item-title"><a href=
"https://www.ilias.de">
ILIAS</a></div></div>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
A Link is the often used combination of a label and an URL.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_audio_player()
ItemTest::test_render_audio_player |
( |
| ) |
|
Definition at line 592 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
597 $audio =
new I\Component\Player\Audio(
"src",
"");
598 $c =
$f->standard(
"title")->withAudioPlayer($audio);
600 $html = $r->render(
$c);
602 <div
class=
"il-item il-std-item ">
603 <div
class=
"il-item-title">title</div>
604 <div
class=
"il-item-audio"><div
class=
"il-audio-container">
605 <audio
class=
"il-audio-player" id=
"id_1" src=
"src" preload=
"metadata"></audio>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_base()
ItemTest::test_render_base |
( |
| ) |
|
Definition at line 181 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
186 $actions =
new I\Component\Dropdown\Standard(array(
190 $c =
$f->standard(
"Item Title")
191 ->withActions($actions)
192 ->withProperties(array(
193 "Origin" =>
"Course Title 1",
194 "Last Update" =>
"24.11.2011",
195 "Location" =>
"Room 123, Main Street 44, 3012 Bern"))
196 ->withDescription(
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
198 $html = $r->render(
$c);
201 <div
class=
"il-item il-std-item ">
202 <div
class=
"il-item-title">Item
Title</div>
203 <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>
204 <ul
id=
"id_3_menu" class=
"dropdown-menu">
205 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1" >
ILIAS</button>
207 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2" >GitHub</button>
211 <div
class=
"il-item-description">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</div>
212 <hr
class=
"il-item-divider" />
214 <div
class=
"col-md-6 il-multi-line-cap-3">
215 <span
class=
"il-item-property-name">Origin</span><span
class=
"il-item-property-value">Course
Title 1</span>
217 <div
class=
"col-md-6 il-multi-line-cap-3">
218 <span
class=
"il-item-property-name">Last Update</span><span
class=
"il-item-property-value">24.11.2011</span>
222 <div
class=
"col-md-6 il-multi-line-cap-3">
223 <span
class=
"il-item-property-name">Location</span><span
class=
"il-item-property-value">Room 123,
Main Street 44, 3012 Bern</span>
225 <div
class=
"col-md-6 il-multi-line-cap-3">
226 <span
class=
"il-item-property-name"></span><span
class=
"il-item-property-value"></span>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_lead_icon()
ItemTest::test_render_lead_icon |
( |
| ) |
|
Definition at line 267 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
272 $icon =
new I\Component\Symbol\Icon\Standard(
"name",
"aria_label",
"small",
false);
274 $c =
$f->standard(
"title")->withLeadIcon($icon);
276 $html = $r->render(
$c);
278 <div
class=
"il-item il-std-item ">
280 <div
class=
"media-left">
281 <img
class=
"icon name small" src=
"./templates/default/images/icon_default.svg" alt=
"aria_label" />
283 <div
class=
"media-body">
284 <div
class=
"il-item-title">title</div>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_lead_image()
ItemTest::test_render_lead_image |
( |
| ) |
|
◆ test_render_lead_letter_avatar()
ItemTest::test_render_lead_letter_avatar |
( |
| ) |
|
Definition at line 296 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
301 $avatar =
new Letter(
'il');
303 $c =
$f->standard(
"title")->withLeadAvatar($avatar);
305 $html = $r->render(
$c);
308 <div
class=
"il-item il-std-item ">
310 <div
class=
"media-left">
311 <span
class=
"il-avatar il-avatar-letter il-avatar-size-large il-avatar-letter-color-11" aria-label=
"user_avatar" role=
"img">
312 <span
class=
"abbreviation">il</span>
315 <div
class=
"media-body">
316 <div
class=
"il-item-title">title</div>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_lead_picture_avatar()
ItemTest::test_render_lead_picture_avatar |
( |
| ) |
|
Definition at line 328 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
333 $avatar =
new Picture(
'./templates/default/images/no_photo_xsmall.jpg',
'demo.user');
335 $c =
$f->standard(
"title")->withLeadAvatar($avatar);
337 $html = $r->render(
$c);
339 <div
class=
"il-item il-std-item ">
341 <div
class=
"media-left">
342 <span
class=
"il-avatar il-avatar-picture il-avatar-size-large">
343 <img src=
"./templates/default/images/no_photo_xsmall.jpg" alt=
"user_avatar"/>
346 <div
class=
"media-body">
347 <div
class=
"il-item-title">title</div>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_lead_text_and_color()
ItemTest::test_render_lead_text_and_color |
( |
| ) |
|
◆ test_render_progress()
ItemTest::test_render_progress |
( |
| ) |
|
Definition at line 359 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
364 $chart =
new I\Component\Chart\ProgressMeter\Standard(100, 75);
366 $c =
$f->standard(
"title")->withProgress($chart);
368 $html = $r->render(
$c);
370 <div
class=
"il-item il-std-item ">
372 <div
class=
"col-sm-9">
373 <div
class=
"il-item-title">title</div>
375 <div
class=
"col-xs-3 col-sm-2 col-lg-2">
376 <div
class=
"il-chart-progressmeter-box ">
377 <div
class=
"il-chart-progressmeter-container">
378 <svg viewBox=
"0 0 50 40" class=
"il-chart-progressmeter-viewbox">
379 <path
class=
"il-chart-progressmeter-circle-bg" stroke-dasharray=
"100, 100" d=
"M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>
380 <g
class=
"il-chart-progressmeter-monocircle">
381 <path
class=
"il-chart-progressmeter-circle no-success" stroke-dasharray=
"75, 100" d=
"M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>
383 <g
class=
"il-chart-progressmeter-text">
384 <text
class=
"text-score-info" x=
"25" y=
"16"></text>
385 <text
class=
"text-score" x=
"25" y=
"25">75 %</text>
386 <text
class=
"text-comparision" x=
"25" y=
"31"></text>
387 <text
class=
"text-comparision-info" x=
"25" y=
"34"></text>
389 <g
class=
"il-chart-progressmeter-needle no-needle" style=
"transform: rotate(deg)">
390 <polygon
class=
"il-chart-progressmeter-needle-border" points=
"23.5,0.1 25,2.3 26.5,0.1"></polygon>
391 <polygon
class=
"il-chart-progressmeter-needle-fill" points=
"23.5,0 25,2.2 26.5,0"></polygon>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_progress_and_lead_icon()
ItemTest::test_render_progress_and_lead_icon |
( |
| ) |
|
Definition at line 459 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
464 $icon =
new I\Component\Symbol\Icon\Standard(
"name",
"aria_label",
"small",
false);
465 $chart =
new I\Component\Chart\ProgressMeter\Standard(100, 75);
467 $c =
$f->standard(
"title")->withLeadIcon($icon)->withProgress($chart);
469 $html = $r->render(
$c);
471 <div
class=
"il-item il-std-item ">
473 <div
class=
"media-left">
474 <img
class=
"icon name small" src=
"./templates/default/images/icon_default.svg" alt=
"aria_label" />
476 <div
class=
"media-body">
477 <div
class=
"il-item-title">title</div>
479 <div
class=
"media-right">
480 <div
class=
"il-chart-progressmeter-box ">
481 <div
class=
"il-chart-progressmeter-container">
482 <svg viewBox=
"0 0 50 40" class=
"il-chart-progressmeter-viewbox">
483 <path
class=
"il-chart-progressmeter-circle-bg" stroke-dasharray=
"100, 100" d=
"M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>
484 <g
class=
"il-chart-progressmeter-monocircle">
485 <path
class=
"il-chart-progressmeter-circle no-success" stroke-dasharray=
"75, 100" d=
"M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>
487 <g
class=
"il-chart-progressmeter-text">
488 <text
class=
"text-score-info" x=
"25" y=
"16"></text>
489 <text
class=
"text-score" x=
"25" y=
"25">75 %</text>
490 <text
class=
"text-comparision" x=
"25" y=
"31"></text>
491 <text
class=
"text-comparision-info" x=
"25" y=
"34"></text>
493 <g
class=
"il-chart-progressmeter-needle no-needle" style=
"transform: rotate(deg)">
494 <polygon
class=
"il-chart-progressmeter-needle-border" points=
"23.5,0.1 25,2.3 26.5,0.1"></polygon>
495 <polygon
class=
"il-chart-progressmeter-needle-fill" points=
"23.5,0 25,2.2 26.5,0"></polygon>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_render_progress_and_lead_image()
ItemTest::test_render_progress_and_lead_image |
( |
| ) |
|
Definition at line 407 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
412 $image =
new I\Component\Image\Image(
"standard",
"src",
"str");
413 $chart =
new I\Component\Chart\ProgressMeter\Standard(100, 75);
415 $c =
$f->standard(
"title")->withLeadImage($image)->withProgress($chart);
417 $html = $r->render(
$c);
419 <div
class=
"il-item il-std-item ">
421 <div
class=
"col-xs-3 col-sm-3 col-lg-2">
422 <img src=
"src" class=
"img-standard" alt=
"str" />
424 <div
class=
"col-xs-6 col-sm-7 col-lg-8">
425 <div
class=
"il-item-title">title</div>
427 <div
class=
"col-xs-3 col-sm-2 col-lg-2">
428 <div
class=
"il-chart-progressmeter-box ">
429 <div
class=
"il-chart-progressmeter-container">
430 <svg viewBox=
"0 0 50 40" class=
"il-chart-progressmeter-viewbox">
431 <path
class=
"il-chart-progressmeter-circle-bg" stroke-dasharray=
"100, 100" d=
"M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>
432 <g
class=
"il-chart-progressmeter-monocircle">
433 <path
class=
"il-chart-progressmeter-circle no-success" stroke-dasharray=
"75, 100" d=
"M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>
435 <g
class=
"il-chart-progressmeter-text">
436 <text
class=
"text-score-info" x=
"25" y=
"16"></text>
437 <text
class=
"text-score" x=
"25" y=
"25">75 %</text>
438 <text
class=
"text-comparision" x=
"25" y=
"31"></text>
439 <text
class=
"text-comparision-info" x=
"25" y=
"34"></text>
441 <g
class=
"il-chart-progressmeter-needle no-needle" style=
"transform: rotate(deg)">
442 <polygon
class=
"il-chart-progressmeter-needle-border" points=
"23.5,0.1 25,2.3 26.5,0.1"></polygon>
443 <polygon
class=
"il-chart-progressmeter-needle-fill" points=
"23.5,0 25,2.2 26.5,0"></polygon>
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
◆ test_shy_title_and_various_properties()
ItemTest::test_shy_title_and_various_properties |
( |
| ) |
|
Definition at line 542 of file ItemTest.php.
References $c, Vendor\Package\$f, ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
546 $df =
new Data\Factory();
548 $df->color(
'#ff00ff');
552 "Property Text" =>
"Text",
553 "Property HTML" =>
"<a>Link</a>",
554 "Property Shy" =>
new I\
Component\
Button\Shy(
"GitHub",
"https://www.github.com"),
555 "Property Icon" =>
new I\
Component\Symbol\Icon\Standard(
"name",
"aria_label",
"small",
false)
560 <div
class=
"il-item il-std-item ">
561 <div
class=
"il-item-title"><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></div> 562 <hr
class=
"il-item-divider" />
564 <div
class=
"col-md-6 il-multi-line-cap-3"><span
class=
"il-item-property-name">Property Text</span><span class="il-item-property-value">Text</span></div>
565 <div
class=
"col-md-6 il-multi-line-cap-3"><span
class=
"il-item-property-name">Property HTML</span><span class="il-item-property-value"><a>
Link</a></span></div> 568 <div
class=
"col-md-6 il-multi-line-cap-3"><span
class=
"il-item-property-name">Property Shy</span><span class="il-item-property-value"><button class="btn btn-link" data-action="https://www.github.com" id="id_2">GitHub</button></span></div>
569 <div
class=
"col-md-6 il-multi-line-cap-3"><span
class=
"il-item-property-name">Property Icon</span><span class="il-item-property-value"><img class="icon name small" src="./templates/default/images/icon_default.svg" alt="aria_label"/></span></div>
574 $this->assertEquals($expected, $html);
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
A Link is the often used combination of a label and an URL.
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...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
ILIAS base class perform basic setup: init database handler, load configuration file, init user authentification & error handler, load object type definitions.
◆ test_with_actions()
ItemTest::test_with_actions |
( |
| ) |
|
Definition at line 84 of file ItemTest.php.
References $c, Vendor\Package\$f, and getFactory().
88 $actions =
new I\Component\Dropdown\Standard(array(
92 $c =
$f->standard(
"title")->withActions($actions);
94 $this->assertEquals(
$c->getActions(), $actions);
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_with_audio_player()
ItemTest::test_with_audio_player |
( |
| ) |
|
Definition at line 171 of file ItemTest.php.
References $c, Vendor\Package\$f, and getFactory().
175 $audio =
new I\Component\Player\Audio(
"src",
"transcript");
176 $c =
$f->standard(
"title")->withAudioPlayer($audio);
178 $this->assertEquals(
$c->getAudioPlayer(), $audio);
◆ test_with_color()
ItemTest::test_with_color |
( |
| ) |
|
Definition at line 97 of file ItemTest.php.
References $c, Vendor\Package\$f, and getFactory().
100 $df =
new Data\Factory();
102 $color = $df->color(
'#ff00ff');
104 $c =
$f->standard(
"title")->withColor($color);
106 $this->assertEquals(
$c->getColor(), $color);
◆ test_with_description()
ItemTest::test_with_description |
( |
| ) |
|
◆ test_with_lead_icon()
ItemTest::test_with_lead_icon |
( |
| ) |
|
Definition at line 120 of file ItemTest.php.
References $c, Vendor\Package\$f, and getFactory().
124 $icon =
new I\Component\Symbol\Icon\Standard(
"name",
"aria_label",
"small",
false);
126 $c =
$f->standard(
"title")->withLeadIcon($icon);
128 $this->assertEquals($icon,
$c->getLead());
◆ test_with_lead_image()
ItemTest::test_with_lead_image |
( |
| ) |
|
Definition at line 109 of file ItemTest.php.
References $c, Vendor\Package\$f, and getFactory().
113 $image =
new I\Component\Image\Image(
"standard",
"src",
"str");
115 $c =
$f->standard(
"title")->withLeadImage($image);
117 $this->assertEquals(
$c->getLead(), $image);
◆ test_with_lead_letter_avatar()
ItemTest::test_with_lead_letter_avatar |
( |
| ) |
|
◆ test_with_lead_picture_avatar()
ItemTest::test_with_lead_picture_avatar |
( |
| ) |
|
◆ test_with_lead_text()
ItemTest::test_with_lead_text |
( |
| ) |
|
◆ test_with_no_lead()
ItemTest::test_with_no_lead |
( |
| ) |
|
◆ test_with_progress()
ItemTest::test_with_progress |
( |
| ) |
|
Definition at line 74 of file ItemTest.php.
References $c, Vendor\Package\$f, and getFactory().
77 $chart =
new I\Component\Chart\ProgressMeter\ProgressMeter(100, 50);
79 $c =
$f->standard(
"title")->withProgress($chart);
81 $this->assertEquals(
$c->getProgress(), $chart);
◆ test_with_properties()
ItemTest::test_with_properties |
( |
| ) |
|
Definition at line 64 of file ItemTest.php.
References $c, Vendor\Package\$f, and getFactory().
68 $props = array(
"prop1" =>
"val1",
"prop2" =>
"val2");
69 $c =
$f->standard(
"title")->withProperties($props);
71 $this->assertEquals(
$c->getProperties(), $props);
The documentation for this class was generated from the following file: