Test secondary legacy panels.
More...
Test secondary legacy panels.
Definition at line 31 of file PanelSecondaryLegacyTest.php.
◆ cleanHTML()
PanelSecondaryLegacyTest::cleanHTML |
( |
string |
$html | ) |
|
|
protected |
◆ getUIFactory()
PanelSecondaryLegacyTest::getUIFactory |
( |
| ) |
|
Definition at line 33 of file PanelSecondaryLegacyTest.php.
References ILIAS\Repository\button(), ILIAS\UI\examples\MainControls\Slate\Legacy\legacy(), and ILIAS\Repository\symbol().
Referenced by testGetLegacyComponent(), testGetTitle(), testImplementsFactoryInterface(), testRenderPanelSecondaryWithActions(), testRenderPanelSecondaryWithFooter(), testRenderPanelSecondaryWithNoHeader(), testRenderPanelSecondaryWithPagination(), testRenderPanelSecondaryWithSection(), testRenderPanelSecondaryWithSortation(), testWithActions(), testWithoutViewControls(), testWithPaginationViewControl(), testWithSectionViewControl(), and testWithSortationViewControl().
36 public function legacyPanel(
string $title,
C\Legacy\Content $content):
I\
Component\Panel\Secondary\Legacy
38 return new I\Component\Panel\Secondary\Legacy($title, $content);
46 public function dropdown():
I\
Component\Dropdown\Factory
48 return new I\Component\Dropdown\Factory();
58 return new I\Component\Button\Factory();
63 return new I\Component\Symbol\Factory(
button(string $caption, string $cmd)
legacy()
expected output: > ILIAS shows the rendered Component.
◆ testGetLegacyComponent()
PanelSecondaryLegacyTest::testGetLegacyComponent |
( |
| ) |
|
Definition at line 95 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
97 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
98 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy);
100 $this->assertEquals($secondary_panel->getLegacyComponent(), $legacy);
◆ testGetTitle()
PanelSecondaryLegacyTest::testGetTitle |
( |
| ) |
|
Definition at line 87 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
89 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
90 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"Title", $legacy);
92 $this->assertEquals(
"Title", $secondary_panel->getTitle());
◆ testImplementsFactoryInterface()
PanelSecondaryLegacyTest::testImplementsFactoryInterface |
( |
| ) |
|
Definition at line 79 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
81 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
82 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"List Title", $legacy);
84 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Panel\\Secondary\\Legacy", $secondary_panel);
◆ testRenderPanelSecondaryWithActions()
PanelSecondaryLegacyTest::testRenderPanelSecondaryWithActions |
( |
| ) |
|
Definition at line 179 of file PanelSecondaryLegacyTest.php.
References ILIAS\Repository\button(), and getUIFactory().
181 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
182 $actions = $this->
getUIFactory()->dropdown()->standard(array(
187 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)->withActions($actions);
189 $html = $this->getDefaultRenderer()->render($sec);
191 $expected_html = <<<EOT
192 <div
class=
"panel panel-secondary panel-flex">
193 <div
class=
"panel-heading ilHeader">
194 <div
class=
"panel-title"><h2>
Title</h2></div>
195 <div
class=
"panel-controls">
196 <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>
197 <ul
id=
"id_3_menu" class=
"dropdown-menu">
198 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
199 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">Github</button></li>
205 <div
class=
"panel-body">
210 $this->assertHTMLEquals(
211 $this->brutallyTrimHTML($expected_html),
212 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
Interface Observer Contains several chained tasks and infos about them.
◆ testRenderPanelSecondaryWithFooter()
PanelSecondaryLegacyTest::testRenderPanelSecondaryWithFooter |
( |
| ) |
|
Definition at line 323 of file PanelSecondaryLegacyTest.php.
References ILIAS\Repository\button(), and getUIFactory().
325 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
326 $footer_shy_button = $this->
getUIFactory()->button()->shy(
"Action",
"");
328 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
329 ->withFooter($footer_shy_button);
331 $html = $this->getDefaultRenderer()->render($secondary_panel);
333 $expected_html = <<<EOT
334 <div
class=
"panel panel-secondary panel-flex">
335 <div
class=
"panel-heading ilHeader">
336 <div
class=
"panel-title"><h2>
Title</h2></div>
337 <div
class=
"panel-controls"></div>
339 <div
class=
"panel-body">
342 <div
class=
"panel-footer ilBlockInfo">
347 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($html));
button(string $caption, string $cmd)
◆ testRenderPanelSecondaryWithNoHeader()
PanelSecondaryLegacyTest::testRenderPanelSecondaryWithNoHeader |
( |
| ) |
|
Definition at line 350 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
352 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
354 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"", $legacy);
356 $html = $this->getDefaultRenderer()->render($secondary_panel);
358 $expected_html = <<<EOT
359 <div
class=
"panel panel-secondary panel-flex">
360 <div
class=
"panel-body">Legacy content</div>
363 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($html));
◆ testRenderPanelSecondaryWithPagination()
PanelSecondaryLegacyTest::testRenderPanelSecondaryWithPagination |
( |
| ) |
|
Definition at line 253 of file PanelSecondaryLegacyTest.php.
References ILIAS\Repository\button(), and getUIFactory().
255 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
257 $pagination = $this->
getUIFactory()->viewControl()->pagination()
258 ->withTargetURL(
'http://ilias.de',
'page')
259 ->withTotalEntries(10)
261 ->withCurrentPage(1);
263 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
264 ->withViewControls([$pagination]);
266 $html = $this->getDefaultRenderer()->render($sec);
268 $expected_html = <<<EOT
269 <div
class=
"panel panel-secondary panel-flex">
270 <div
class=
"panel-heading ilHeader">
271 <div
class=
"panel-title"><h2>
Title</h2></div>
272 <div
class=
"panel-viewcontrols l-bar__space-keeper">
273 <div
class=
"il-viewcontrol-pagination l-bar__element">
274 <span
class=
"btn btn-ctrl browse previous"><a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=0" aria-label=
"back"><span
class=
"glyphicon glyphicon-chevron-left" aria-hidden=
"true"></span></a></span>
275 <
button class=
"btn btn-link" data-action=
"http://ilias.de?page=0" id=
"id_1">1</button>
276 <button
class=
"btn btn-link engaged" aria-pressed=
"true" data-action=
"http://ilias.de?page=1" id=
"id_2">2</button>
277 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=2" id=
"id_3">3</button>
278 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=3" id=
"id_4">4</button>
279 <button
class=
"btn btn-link" data-action=
"http://ilias.de?page=4" id=
"id_5">5</button>
280 <span
class=
"btn btn-ctrl browse next"><a tabindex=
"0" class=
"glyph" href=
"http://ilias.de?page=2" aria-label=
"next"><span
class=
"glyphicon glyphicon-chevron-right" aria-hidden=
"true"></span></a></span>
283 <div
class=
"panel-controls"></div>
285 <div
class=
"panel-body">Legacy content</div>
288 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($html));
button(string $caption, string $cmd)
◆ testRenderPanelSecondaryWithSection()
PanelSecondaryLegacyTest::testRenderPanelSecondaryWithSection |
( |
| ) |
|
Definition at line 291 of file PanelSecondaryLegacyTest.php.
References ILIAS\Repository\button(), and getUIFactory().
293 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
294 $back = $this->
getUIFactory()->button()->standard(
"previous",
"http://www.ilias.de");
295 $next = $this->
getUIFactory()->button()->standard(
"next",
"http://www.github.com");
296 $current = $this->
getUIFactory()->button()->standard(
"current",
"");
297 $section = $this->
getUIFactory()->viewControl()->section($back, $current, $next);
299 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
300 ->withViewControls([$section]);
302 $html = $this->getDefaultRenderer()->render($secondary_panel);
304 $expected_html = <<<EOT
305 <div
class=
"panel panel-secondary panel-flex">
306 <div
class=
"panel-heading ilHeader">
307 <div
class=
"panel-title"><h2>
Title</h2></div>
308 <div
class=
"panel-viewcontrols l-bar__space-keeper">
309 <div
class=
"il-viewcontrol-section l-bar__element">
310 <a
class=
"btn btn-ctrl browse previous" href=
"http://www.ilias.de" aria-label=
"previous" data-action=
"http://www.ilias.de" id=
"id_1"><span
class=
"glyphicon glyphicon-chevron-left"></span></a>
311 <
button class=
"btn btn-default" data-action=
"">current</button>
312 <a
class=
"btn btn-ctrl browse next" href=
"http://www.github.com" aria-label=
"next" data-action=
"http://www.github.com" id=
"id_2"><span
class=
"glyphicon glyphicon-chevron-right"></span></a>
315 <div
class=
"panel-controls"></div>
317 <div
class=
"panel-body">Legacy content</div>
320 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($html));
button(string $caption, string $cmd)
◆ testRenderPanelSecondaryWithSortation()
PanelSecondaryLegacyTest::testRenderPanelSecondaryWithSortation |
( |
| ) |
|
Definition at line 216 of file PanelSecondaryLegacyTest.php.
References ILIAS\Repository\button(), and getUIFactory().
218 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
219 $sort_options = array(
223 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'b');
224 $sec = $this->
getUIFactory()->legacyPanel(
"Title", $legacy)
225 ->withViewControls([$sortation]);
227 $html = $this->getDefaultRenderer()->render($sec);
229 $expected_html = <<<EOT
230 <div
class=
"panel panel-secondary panel-flex">
231 <div
class=
"panel-heading ilHeader">
232 <div
class=
"panel-title"><h2>
Title</h2></div>
233 <div
class=
"panel-viewcontrols l-bar__space-keeper">
234 <div
class=
"dropdown il-viewcontrol il-viewcontrol-sortation l-bar__element" id=
"id_1">
235 <
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">
236 <span
class=
"label">vc_sort
B</span>
237 <span
class=
"glyphicon-sort"></span>
239 <ul
id=
"id_1_ctrl" class=
"dropdown-menu">
240 <li><
button class=
"btn btn-link" data-action=
"?sortation=a" id=
"id_2">
A</button></li>
241 <li
class=
"selected"><button
class=
"btn btn-link" data-action=
"?sortation=b" id=
"id_3">
B</button></li>
245 <div
class=
"panel-controls"></div>
247 <div
class=
"panel-body">Legacy content</div>
250 $this->assertEquals($this->brutallyTrimHTML($expected_html), $this->brutallyTrimHTML($html));
button(string $caption, string $cmd)
◆ testWithActions()
PanelSecondaryLegacyTest::testWithActions |
( |
| ) |
|
◆ testWithoutViewControls()
PanelSecondaryLegacyTest::testWithoutViewControls |
( |
| ) |
|
Definition at line 117 of file PanelSecondaryLegacyTest.php.
References getUIFactory(), and null.
119 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
120 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy);
121 $array_vc = $secondary_panel->getViewControls();
123 $this->assertEquals(
null, $array_vc);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testWithPaginationViewControl()
PanelSecondaryLegacyTest::testWithPaginationViewControl |
( |
| ) |
|
Definition at line 144 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
146 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
147 $pagination = $this->
getUIFactory()->viewControl()->pagination()
148 ->withTargetURL(
"http://ilias.de",
'page')
149 ->withTotalEntries(98)
151 ->withCurrentPage(1);
153 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
154 ->withViewControls([$pagination]);
156 $array_vc = $secondary_panel->getViewControls();
158 $this->assertEquals($array_vc[0], $pagination);
◆ testWithSectionViewControl()
PanelSecondaryLegacyTest::testWithSectionViewControl |
( |
| ) |
|
Definition at line 161 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
163 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
164 $back = $this->
getUIFactory()->button()->standard(
"previous",
"http://www.ilias.de");
165 $next = $this->
getUIFactory()->button()->standard(
"next",
"http://www.github.com");
166 $current = $this->
getUIFactory()->button()->standard(
"current",
"");
167 $section = $this->
getUIFactory()->viewControl()->section($back, $current, $next);
169 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
170 ->withViewControls([$section]);
172 $array_vc = $secondary_panel->getViewControls();
174 $this->assertEquals($array_vc[0], $section);
◆ testWithSortationViewControl()
PanelSecondaryLegacyTest::testWithSortationViewControl |
( |
| ) |
|
Definition at line 126 of file PanelSecondaryLegacyTest.php.
References getUIFactory().
128 $legacy = $this->getUIfactory()->legacy()->content(
"Legacy content");
129 $sort_options = array(
130 'internal_rating' =>
'Best',
131 'date_desc' =>
'Most Recent',
132 'date_asc' =>
'Oldest',
134 $sortation = $this->
getUIFactory()->viewControl()->sortation($sort_options,
'internal_rating');
136 $secondary_panel = $this->
getUIFactory()->legacyPanel(
"title", $legacy)
137 ->withViewControls([$sortation]);
139 $array_vc = $secondary_panel->getViewControls();
141 $this->assertEquals($array_vc[0], $sortation);
The documentation for this class was generated from the following file: