3 declare(strict_types=1);
21 require_once(
"libs/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../Base.php");
34 'internal_rating' =>
'Best',
35 'date_desc' =>
'Most Recent',
36 'date_asc' =>
'Oldest',
41 return new I\Component\ViewControl\Factory(
49 $sortation =
$f->sortation($this->options);
50 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Sortation", $sortation);
51 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Signal", $sortation->getSelectSignal());
57 $s =
$f->sortation($this->options);
59 $this->assertEquals($this->options, $s->getOptions());
61 $this->assertEquals(
'label', $s->withLabel(
'label')->getLabel());
63 $s = $s->withTargetURL(
'#',
'param');
64 $this->assertEquals(
'#', $s->getTargetURL());
65 $this->assertEquals(
'param', $s->getParameterName());
67 $this->assertEquals(array(), $s->getTriggeredSignals());
69 $signal = $generator->create();
70 $this->assertEquals($signal, $s->withOnSort($signal)->getTriggeredSignals()[0]->getSignal());
77 $s =
$f->sortation($this->options);
87 $s =
$f->sortation($this->options)->withAdditionalOnLoadCode(
function (
$id) {
100 $button3_id =
"id_3";
101 $dropdown_id =
"id_4";
105 $button1_id =
"id_2";
106 $button2_id =
"id_3";
107 $button3_id =
"id_4";
108 $dropdown_id =
"id_5";
111 $dropdown_menu_id = $dropdown_id.
"_menu";
114 <div
class=
"il-viewcontrol-sortation" $id><div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" id=
"$dropdown_id" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"$dropdown_menu_id" > <span
class=
"caret"></span></button><ul
id=
"$dropdown_menu_id" class=
"dropdown-menu">
115 <li><button
class=
"btn btn-link" data-action=
"?sortation=internal_rating" id=
"$button1_id">Best</button></li>
116 <li><button
class=
"btn btn-link" data-action=
"?sortation=date_desc" id=
"$button2_id">Most Recent</button></li>
117 <li><button
class=
"btn btn-link" data-action=
"?sortation=date_asc" id=
"$button3_id">Oldest</button></li></ul></div>
126 public function button(): C\Button\Factory
128 return new I\Component\Button\Factory();
130 public function dropdown(): C\Dropdown\Factory
132 return new I\Component\Dropdown\Factory();
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testRenderingWithJsBinding()
getSortationExpectedHTML(bool $with_id=false)
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Provides common functionality for UI tests.
Test on icon implementation.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins