Tests for Presentation Table.
More...
Tests for Presentation Table.
Definition at line 31 of file PresentationTest.php.
◆ getDummyData()
| PresentationTest::getDummyData |
( |
| ) |
|
|
protected |
Definition at line 111 of file PresentationTest.php.
114 'headline' =>
'some title',
115 'subhead' =>
'some type',
116 'important_fields' => [
'important-1',
'important-2'],
117 'content' => [
'1st' =>
'first content',
'2nd' =>
'second content'],
118 'further_headline' =>
'further fields',
119 'further_fields' => [
'f-1' =>
'further',
'f-2' =>
'way further'],
◆ getUIFactory()
| PresentationTest::getUIFactory |
( |
| ) |
|
Definition at line 87 of file PresentationTest.php.
References ILIAS\Repository\button(), and ILIAS\Repository\symbol().
90 public I\Component\SignalGenerator $sig_gen;
94 return new I\Component\Button\Factory(
100 return new I\Component\Symbol\Factory(
107 $factory->sig_gen =
new I\Component\SignalGenerator();
button(string $caption, string $cmd)
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...
◆ testFullRendering()
| PresentationTest::testFullRendering |
( |
| ) |
|
Definition at line 124 of file PresentationTest.php.
References Vendor\Package\$f, $r, ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\brutallyTrimSignals(), ILIAS\Repository\button(), ILIAS_UI_TestBase\getDefaultRenderer(), TableTestBase\getTableFactory(), and ILIAS\UI\examples\ViewControl\Sortation\small().
126 $mapping =
function ($row, $record, $ui_factory, $environment) {
128 ->withHeadline($record[
'headline'])
129 ->withSubheadline($record[
'subhead'])
130 ->withImportantFields($record[
'important_fields'])
131 ->withContent((
new I\
Component\Listing\Descriptive($record[
'content'])))
132 ->withFurtherFieldsHeadline($record[
'further_headline'])
133 ->withFurtherFields($record[
'further_fields'])
138 <div
class=
"il-table-presentation" id=
"id_3">
139 <h3
class=
"ilHeader">title</h3>
140 <div
class=
"il-table-presentation-viewcontrols">
141 <div
class=
"l-bar__space-keeper l-bar__space-keeper--space-between">
142 <div
class=
"l-bar__group">
143 <div
class=
"l-bar__element">
144 <
button class=
"btn btn-default" id=
"id_1">presentation_table_expand</
button>
145 <
button class=
"btn btn-default" id=
"id_2">presentation_table_collapse</button>
148 <div
class=
"l-bar__group"></div>
151 <div
class=
"il-table-presentation-data">
152 <div
class=
"il-table-presentation-row row collapsed" id=
"id_4">
154 <div
class=
"il-table-presentation-row-controls col-lg-auto col-sm-12">
155 <div
class=
"il-table-presentation-row-controls-expander inline">
156 <a tabindex=
"0" class=
"glyph" href=
"#" aria-label=
"expand_content" id=
"id_5">
157 <span
class=
"glyphicon glyphicon-triangle-right" aria-hidden=
"true"></span>
160 <div
class=
"il-table-presentation-row-controls-collapser">
161 <a tabindex=
"0" class=
"glyph" href=
"#" aria-label=
"collapse_content" id=
"id_6">
162 <span
class=
"glyphicon glyphicon-triangle-bottom" aria-hidden=
"true"></span>
167 <div
class=
"il-table-presentation-row-contents col-lg col-sm-12">
169 <div
class=
"il-table-presentation-row-header col-lg col-sm-12">
170 <h4
class=
"il-table-presentation-row-header-headline" onClick=
"$(document).trigger('il_signal...');">some title<br /><
small>some type</
small>
172 <div
class=
"il-table-presentation-row-header-fields">
173 <div
class=
"l-bar__space-keeper">
174 <div
class=
"l-bar__group">
175 <div
class=
"il-table-presentation-row-header-fields-value l-bar__element">important-1</div>
178 <div
class=
"l-bar__space-keeper">
179 <div
class=
"l-bar__group">
180 <div
class=
"il-table-presentation-row-header-fields-value l-bar__element">important-2</div>
183 <button
class=
"btn btn-link" id=
"id_7">presentation_table_more</button>
186 <div
class=
"il-table-presentation-actions col-lg-auto col-sm-12">
187 <button
class=
"btn btn-default" data-action=
"#" id=
"id_8">
do</button><br />
189 <div
class=
"il-table-presentation-row-expanded col-lg-12 col-sm-12">
191 <div
class=
"il-table-presentation-desclist col-lg col-sm-12 desclist-column">
194 <dd>first content</dd>
196 <dd>second content</dd>
199 <div
class=
"il-table-presentation-details col-lg-5 col-sm-12">
200 <div
class=
"il-table-presentation-fields">
201 <h5>further fields</h5>
202 <span
class=
"il-item-property-name">f-1</span>
203 <span
class=
"il-item-property-value">further</span>
205 <span
class=
"il-item-property-name">f-2</span>
206 <span
class=
"il-item-property-value">way further</span>
221 $pt =
$f->presentation(
'title', [], $mapping);
222 $actual =
$r->render($pt->withData($this->getDummyData()));
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
button(string $caption, string $cmd)
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.
brutallyTrimSignals(string $html)
A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output...
◆ testMinimalRendering()
| PresentationTest::testMinimalRendering |
( |
| ) |
|
Definition at line 230 of file PresentationTest.php.
References Vendor\Package\$f, $r, ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\brutallyTrimSignals(), ILIAS\Repository\button(), ILIAS_UI_TestBase\getDefaultRenderer(), and TableTestBase\getTableFactory().
232 $mapping =
function ($row, $record, $ui_factory, $environment) {
234 ->withHeadline($record[
'headline'])
235 ->withContent((
new I\
Component\Listing\Descriptive($record[
'content'])));
239 <div
class=
"il-table-presentation" id=
"id_3">
240 <h3
class=
"ilHeader">title</h3>
241 <div
class=
"il-table-presentation-viewcontrols">
243 <div
class=
"l-bar__space-keeper l-bar__space-keeper--space-between">
244 <div
class=
"l-bar__group">
245 <div
class=
"l-bar__element">
247 <
button class=
"btn btn-default" id=
"id_1">presentation_table_expand</
button>
248 <
button class=
"btn btn-default" id=
"id_2">presentation_table_collapse</button>
251 <div
class=
"l-bar__group"></div>
254 <div
class=
"il-table-presentation-data">
255 <div
class=
"il-table-presentation-row row collapsed" id=
"id_4">
257 <div
class=
"il-table-presentation-row-controls col-lg-auto col-sm-12">
258 <div
class=
"il-table-presentation-row-controls-expander inline">
259 <a tabindex=
"0" class=
"glyph" href=
"#" aria-label=
"expand_content" id=
"id_5">
260 <span
class=
"glyphicon glyphicon-triangle-right" aria-hidden=
"true"></span>
263 <div
class=
"il-table-presentation-row-controls-collapser">
264 <a tabindex=
"0" class=
"glyph" href=
"#" aria-label=
"collapse_content" id=
"id_6">
265 <span
class=
"glyphicon glyphicon-triangle-bottom" aria-hidden=
"true"></span>
270 <div
class=
"il-table-presentation-row-contents col-lg col-sm-12">
272 <div
class=
"il-table-presentation-row-header col-lg col-sm-12">
273 <h4
class=
"il-table-presentation-row-header-headline" onClick=
"$(document).trigger('il_signal...');">some title</h4>
274 <div
class=
"il-table-presentation-row-header-fields">
275 <button
class=
"btn btn-link" id=
"id_7">presentation_table_more</button>
278 <div
class=
"il-table-presentation-actions col-lg-auto col-sm-12"></div>
279 <div
class=
"il-table-presentation-row-expanded col-lg-12 col-sm-12">
281 <div
class=
"il-table-presentation-desclist col-lg col-sm-12">
284 <dd>first content</dd>
286 <dd>second content</dd>
300 $pt =
$f->presentation(
'title', [], $mapping);
301 $actual =
$r->render($pt->withData($this->getDummyData()));
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
button(string $caption, string $cmd)
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.
brutallyTrimSignals(string $html)
A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output...
◆ testRenderEmptyTableEntry()
| PresentationTest::testRenderEmptyTableEntry |
( |
| ) |
|
◆ testRowConstruction()
| PresentationTest::testRowConstruction |
( |
| ) |
|
Definition at line 53 of file PresentationTest.php.
References Vendor\Package\$f, and TableTestBase\getTableFactory().
56 $pt =
$f->presentation(
'title', [],
function ():
void {
60 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Table\\PresentationRow", $row);
61 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal", $row->getShowSignal());
62 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal", $row->getCloseSignal());
63 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal", $row->getToggleSignal());
67 $row->withHeadline(
"headline")->getHeadline()
71 $row->withSubheadline(
"subheadline")->getSubheadline()
75 $row->withImportantFields(array(
"f1" =>
"v1"))->getImportantFields()
79 $row->withFurtherFieldsHeadline(
"field_headline")->getFurtherFieldsHeadline()
82 array(
"ff1" =>
"fv1"),
83 $row->withFurtherFields(array(
"ff1" =>
"fv1"))->getFurtherFields()
◆ testTableConstruction()
| PresentationTest::testTableConstruction |
( |
| ) |
|
Definition at line 33 of file PresentationTest.php.
References Vendor\Package\$f, and TableTestBase\getTableFactory().
36 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Table\\Factory",
$f);
38 $pt =
$f->presentation(
'title', [],
function ():
void {
40 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Table\\Presentation", $pt);
42 $this->assertEquals(
"title", $pt->getTitle());
43 $this->assertEquals([], $pt->getViewControls());
44 $this->assertInstanceOf(Closure::class, $pt->getRowMapping());
47 ->withEnvironment(array(
'k' =>
'v'))
48 ->withData(array(
'dk' =>
'dv'));
49 $this->assertEquals(array(
'k' =>
'v'), $pt->getEnvironment());
50 $this->assertEquals(array(
'dk' =>
'dv'), $pt->getData());
The documentation for this class was generated from the following file: