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\Component\SignalGenerator;
12 "ILIAS" =>
"http://www.ilias.de",
13 "Github" =>
"http://www.github.com" 22 return new \ILIAS\UI\Implementation\Component\ViewControl\Factory(
new SignalGenerator());
30 $back = $button_f->standard(
"",
"http://www.ilias.de");
31 $next = $button_f->standard(
"",
"http://www.github.com");
32 $button = $button_f->standard(
"Today",
"");
34 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button", $back);
35 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button", $next);
36 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button", $button);
37 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Factory", $view_control_f);
39 $section = $view_control_f->section($back, $button, $next);
40 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Section",
$section);
48 $back = $button_f->standard(
"",
"http://www.ilias.de");
49 $next = $button_f->standard(
"",
"http://www.github.com");
50 $button = $button_f->standard(
"Today",
"");
54 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button",
$action);
61 $back = $button_f->standard(
"",
"http://www.ilias.de");
62 $next = $button_f->standard(
"",
"http://www.github.com");
63 $button = $button_f->standard(
"Today",
"");
67 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Button\\Button",
$action);
77 $back = $button_f->standard(
"",
"http://www.ilias.de");
78 $next = $button_f->standard(
"",
"http://www.github.com");
79 $button = $button_f->standard(
"Today",
"");
81 $section = $view_control_f->section($back, $button, $next);
84 $this->assertContains(
"glyphicon-chevron-left",
$html);
85 $this->assertContains(
"glyphicon-chevron-right",
$html);
86 $this->assertContains(
"il-viewcontrol-section",
$html);
89 $this->assertContains(
"btn",
$html);
95 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\ViewControl\\Factory", $f);
102 $this->assertEquals($this->active, $f->mode($this->actions, $this->aria_label)->withActive($this->active)->getActive());
103 $this->assertNotEquals($this->active, $f->mode($this->actions, $this->aria_label)->withActive(
"Dummy text")->getActive());
111 $this->assertInternalType(
"array", $f->mode($this->actions, $this->aria_label)->getLabelledActions());
118 $mode = $f->mode($this->actions, $this->aria_label);
124 $activate_first_item =
true;
127 $expected =
"<div class=\"btn-group il-viewcontrol-mode\" aria-label=\"" . $this->aria_label .
"\" role=\"" . $this->role .
"\">";
128 foreach ($this->actions as $label =>
$action) {
129 if ($activate_first_item) {
130 $expected .=
"<a class=\"btn btn-default ilSubmitInactive disabled\" aria-label=\"$label\" aria-checked=\"true\" data-action=\"$action\">$label</a>";
131 $activate_first_item =
false;
132 } elseif ($active == $label) {
133 $expected .=
"<a class=\"btn btn-default ilSubmitInactive disabled \" aria-label=\"$label\" aria-checked=\"true\" data-action=\"$action\">$label</a>";
135 $expected .=
"<a class=\"btn btn-default\" href=\"$action\" aria-label=\"$label\" data-action=\"$action\">$label</a>";
138 $expected .=
"</div>";
145 return new \ILIAS\UI\Implementation\Factory();
151 <div
class=
"il-viewcontrol-section">
152 <a
class=
"btn btn-default " type=
"button" 153 href=
"http://www.ilias.de" data-action=
"http://www.ilias.de" 154 ><span
class=
"glyphicon glyphicon-chevron-left"></span></a>
155 <a
class=
"btn btn-default" href=
"" data-action=
"">Today</a>
156 <a
class=
"btn btn-default " type=
"button" 157 href=
"http://www.github.com" data-action=
"http://www.github.com" 158 ><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)
Create styles array
The data for the language used.
test_viewcontrol_get_actions()