Test items.
More...
Test items.
Definition at line 13 of file ItemTest.php.
◆ getFactory()
- Returns
Definition at line 19 of file ItemTest.php.
Referenced by test_get_title(), test_implements_factory_interface(), test_render_base(), test_render_lead_image(), test_render_lead_text_and_color(), test_shy_title_and_property(), test_with_actions(), test_with_color(), test_with_description(), test_with_lead_image(), test_with_lead_text(), test_with_no_lead(), and test_with_properties().
21 return new \ILIAS\UI\Implementation\Factory();
◆ test_get_title()
ItemTest::test_get_title |
( |
| ) |
|
Definition at line 31 of file ItemTest.php.
References getFactory().
34 $c = $f->item()->standard(
"title");
36 $this->assertEquals($c->getTitle(),
"title");
◆ test_implements_factory_interface()
ItemTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 24 of file ItemTest.php.
References getFactory().
28 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Item\\Standard", $f->item()->standard(
"title"));
◆ test_render_base()
ItemTest::test_render_base |
( |
| ) |
|
Definition at line 112 of file ItemTest.php.
References $html, $r, array, ILIAS_UI_TestBase\assertHTMLEquals(), data, ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
117 $actions = $f->dropdown()->standard(
array(
118 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
119 $f->button()->shy(
"GitHub",
"https://www.github.com")
121 $c = $f->item()->standard(
"Item Title")
122 ->withActions($actions)
123 ->withProperties(
array(
124 "Origin" =>
"Course Title 1",
125 "Last Update" =>
"24.11.2011",
126 "Location" =>
"Room 123, Main Street 44, 3012 Bern"))
127 ->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.");
131 <div
class=
"il-item il-std-item ">
133 <div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-haspopup=
"true" aria-expanded=
"false" > <span
class=
"caret"></span></button>
134 <ul
class=
"dropdown-menu">
135 <li><a
class=
"btn btn-link" href=
"https://www.ilias.de" data-action=
"https://www.ilias.de" >
ILIAS</a></li>
136 <li><a
class=
"btn btn-link" href=
"https://www.github.com" data-action=
"https://www.github.com" >GitHub</a></li>
139 <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>
140 <hr
class=
"il-item-divider" />
142 <div
class=
"col-md-6">
144 <div
class=
"col-sm-5 il-item-property-name">Origin</div>
145 <div
class=
"col-sm-7 il-item-property-value il-multi-line-cap-3">Course
Title 1</div>
148 <div
class=
"col-md-6">
150 <div
class=
"col-sm-5 il-item-property-name">Last Update</div>
151 <div
class=
"col-sm-7 il-item-property-value il-multi-line-cap-3">24.11.2011</div>
156 <div
class=
"col-md-6">
158 <div
class=
"col-sm-5 il-item-property-name">Location</div>
159 <div
class=
"col-sm-7 il-item-property-value il-multi-line-cap-3">Room 123, Main Street 44, 3012 Bern</div>
162 <div
class=
"col-md-6">
164 <div
class=
"col-sm-5 il-item-property-name"></div>
165 <div
class=
"col-sm-7 il-item-property-value il-multi-line-cap-3"></div>
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
Create styles array
The data for the language used.
◆ test_render_lead_image()
ItemTest::test_render_lead_image |
( |
| ) |
|
◆ test_render_lead_text_and_color()
ItemTest::test_render_lead_text_and_color |
( |
| ) |
|
Definition at line 202 of file ItemTest.php.
References $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
206 $df = new \ILIAS\Data\Factory();
208 $color = $df->color(
'#ff00ff');
210 $c = $f->item()->standard(
"title")->withColor($color)->withLeadText(
"lead");
215 <div
class=
"il-item il-std-item il-item-marker " style=
"border-color:#ff00ff">
217 <div
class=
"col-sm-3">
220 <div
class=
"col-sm-9">
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_shy_title_and_property()
ItemTest::test_shy_title_and_property |
( |
| ) |
|
Definition at line 230 of file ItemTest.php.
References $html, $r, array, ILIAS_UI_TestBase\assertHTMLEquals(), data, ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
234 $df = new \ILIAS\Data\Factory();
236 $color = $df->color(
'#ff00ff');
238 $c = $f->item()->standard($f->button()->shy(
"ILIAS",
"https://www.ilias.de"))
239 ->withProperties(
array(
"test" => $f->button()->shy(
"GitHub",
"https://www.github.com")));
243 <div
class=
"il-item il-std-item ">
244 <h5><a
class=
"btn btn-link" href=
"https://www.ilias.de" data-action=
"https://www.ilias.de" >
ILIAS</a></h5>
245 <hr
class=
"il-item-divider" />
247 <div
class=
"col-md-6">
249 <div
class=
"col-sm-5 il-item-property-name">test</div>
250 <div
class=
"col-sm-7 il-item-property-value il-multi-line-cap-3"><a
class=
"btn btn-link" href=
"https://www.github.com" data-action=
"https://www.github.com" >GitHub</a></div>
253 <div
class=
"col-md-6">
255 <div
class=
"col-sm-5 il-item-property-name"></div>
256 <div
class=
"col-sm-7 il-item-property-value il-multi-line-cap-3"></div>
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
Create styles array
The data for the language used.
◆ test_with_actions()
ItemTest::test_with_actions |
( |
| ) |
|
Definition at line 58 of file ItemTest.php.
References array, and getFactory().
62 $actions = $f->dropdown()->standard(
array(
63 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
64 $f->button()->shy(
"GitHub",
"https://www.github.com")
66 $c = $f->item()->standard(
"title")->withActions($actions);
68 $this->assertEquals($c->getActions(), $actions);
Create styles array
The data for the language used.
◆ test_with_color()
ItemTest::test_with_color |
( |
| ) |
|
Definition at line 71 of file ItemTest.php.
References getFactory().
74 $df = new \ILIAS\Data\Factory();
76 $color = $df->color(
'#ff00ff');
78 $c = $f->item()->standard(
"title")->withColor($color);
80 $this->assertEquals($c->getColor(), $color);
◆ test_with_description()
ItemTest::test_with_description |
( |
| ) |
|
Definition at line 39 of file ItemTest.php.
References getFactory().
43 $c = $f->item()->standard(
"title")->withDescription(
"description");
45 $this->assertEquals($c->getDescription(),
"description");
◆ test_with_lead_image()
ItemTest::test_with_lead_image |
( |
| ) |
|
Definition at line 83 of file ItemTest.php.
References getFactory().
87 $image = $f->image()->standard(
"src",
"str");
89 $c = $f->item()->standard(
"title")->withLeadImage($image);
91 $this->assertEquals($c->getLead(), $image);
◆ test_with_lead_text()
ItemTest::test_with_lead_text |
( |
| ) |
|
Definition at line 94 of file ItemTest.php.
References getFactory().
98 $c = $f->item()->standard(
"title")->withLeadText(
"text");
100 $this->assertEquals($c->getLead(),
"text");
◆ test_with_no_lead()
ItemTest::test_with_no_lead |
( |
| ) |
|
Definition at line 103 of file ItemTest.php.
References getFactory().
107 $c = $f->item()->standard(
"title")->withLeadText(
"text")->withNoLead();
109 $this->assertEquals($c->getLead(), null);
◆ test_with_properties()
ItemTest::test_with_properties |
( |
| ) |
|
Definition at line 48 of file ItemTest.php.
References array, and getFactory().
52 $props =
array(
"prop1" =>
"val1",
"prop2" =>
"val2");
53 $c = $f->item()->standard(
"title")->withProperties($props);
55 $this->assertEquals($c->getProperties(), $props);
Create styles array
The data for the language used.
The documentation for this class was generated from the following file: