3 require_once(__DIR__ .
"/../../../../libs/composer/vendor/autoload.php");
4 require_once(__DIR__ .
"/../../Base.php");
6 use \ILIAS\UI\Component as
C;
7 use \ILIAS\UI\Implementation as
I;
8 use \ILIAS\UI\Implementation\Component\SignalGenerator;
13 "ILIAS" =>
"http://www.ilias.de",
14 "Github" =>
"http://www.github.com" 29 $button_f =
new I\Component\Button\Factory();
31 $back =
new I\Component\Button\Standard(
"",
"http://www.ilias.de");
32 $next =
new I\Component\Button\Standard(
"",
"http://www.github.com");
33 $button =
new I\Component\Button\Standard(
"Today",
"");
35 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button", $back);
36 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button", $next);
37 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button", $button);
38 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Factory", $view_control_f);
40 $section = $view_control_f->section($back, $button, $next);
41 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Section",
$section);
49 $back = $button_f->standard(
"",
"http://www.ilias.de");
50 $next = $button_f->standard(
"",
"http://www.github.com");
51 $button = $button_f->standard(
"Today",
"");
55 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button",
$action);
62 $back = $button_f->standard(
"",
"http://www.ilias.de");
63 $next = $button_f->standard(
"",
"http://www.github.com");
64 $button = $button_f->standard(
"Today",
"");
68 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button",
$action);
78 $back = $button_f->standard(
"",
"http://www.ilias.de");
79 $next = $button_f->standard(
"",
"http://www.github.com");
80 $button = $button_f->standard(
"Today",
"");
82 $section = $view_control_f->section($back, $button, $next);
85 $this->assertContains(
"glyphicon-chevron-left",
$html);
86 $this->assertContains(
"glyphicon-chevron-right",
$html);
87 $this->assertContains(
"il-viewcontrol-section",
$html);
90 $this->assertContains(
"btn",
$html);
96 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Factory",
$f);
103 $this->assertEquals($this->active,
$f->mode($this->actions, $this->aria_label)->withActive($this->active)->getActive());
104 $this->assertNotEquals($this->active,
$f->mode($this->actions, $this->aria_label)->withActive(
"Dummy text")->getActive());
112 $this->assertInternalType(
"array",
$f->mode($this->actions, $this->aria_label)->getLabelledActions());
119 $mode =
$f->mode($this->actions, $this->aria_label);
125 $activate_first_item =
true;
128 $expected =
"<div class=\"btn-group il-viewcontrol-mode\" aria-label=\"" . $this->aria_label .
"\" role=\"" . $this->role .
"\">";
129 foreach ($this->actions as $label =>
$action) {
130 if ($activate_first_item) {
131 $expected .=
"<button class=\"btn btn-default ilSubmitInactive disabled\" aria-label=\"$label\" aria-checked=\"true\" data-action=\"$action\">$label</button>";
132 $activate_first_item =
false;
133 } elseif ($active == $label) {
134 $expected .=
"<button class=\"btn btn-default ilSubmitInactive disabled \" aria-label=\"$label\" aria-checked=\"true\" data-action=\"$action\">$label</button>";
136 $expected .=
"<button class=\"btn btn-default\" aria-label=\"$label\" data-action=\"$action\" id=\"id_1\">$label</button>";
139 $expected .=
"</div>";
146 return new \ILIAS\UI\Implementation\Factory(
148 $this->createMock(
C\Glyph\Factory::class),
150 $this->createMock(
C\Listing\Factory::class),
151 $this->createMock(
C\Image\Factory::class),
152 $this->createMock(
C\Panel\Factory::class),
153 $this->createMock(
C\Modal\Factory::class),
154 $this->createMock(
C\Dropzone\Factory::class),
155 $this->createMock(
C\Popover\Factory::class),
156 $this->createMock(
C\Divider\Factory::class),
157 $this->createMock(
C\Link\Factory::class),
158 $this->createMock(
C\Dropdown\Factory::class),
159 $this->createMock(
C\Item\Factory::class),
160 $this->createMock(
C\Icon\Factory::class),
161 $this->createMock(
C\ViewControl\Factory::class),
162 $this->createMock(
C\Chart\Factory::class),
163 $this->createMock(
C\Input\Factory::class),
164 $this->createMock(
C\Table\Factory::class),
165 $this->createMock(
C\MessageBox\Factory::class),
166 $this->createMock(
C\
Card\Factory::class)
173 <div
class=
"il-viewcontrol-section">
174 <
a class=
"btn btn-default " href=
"http://www.ilias.de" data-action=
"http://www.ilias.de"><span
class=
"glyphicon glyphicon-chevron-left"></span></
a>
175 <button
class=
"btn btn-default" data-action=
"">Today</button>
176 <
a class=
"btn btn-default " href=
"http://www.github.com" data-action=
"http://www.github.com"><span
class=
"glyphicon glyphicon-chevron-right"></span></a>
test_implements_factory_interface()
test_viewcontrol_section_get_previous_actions()
test_render_viewcontrol_mode()
test_viewcontrol_section_get_next_actions()
test_render_viewcontrol_section()
test_viewcontrol_with_active()
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)
test_viewcontrol_get_actions()