Definition at line 10 of file ViewControlTest.php.
◆ getSectionExpectedHTML()
ViewControlTest::getSectionExpectedHTML |
( |
| ) |
|
|
protected |
Definition at line 170 of file ViewControlTest.php.
References data.
Referenced by test_render_viewcontrol_section().
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>
◆ getUIFactory()
ViewControlTest::getUIFactory |
( |
| ) |
|
Definition at line 144 of file ViewControlTest.php.
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)
◆ getViewControlFactory()
ViewControlTest::getViewControlFactory |
( |
| ) |
|
◆ test_implements_factory_interface()
ViewControlTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 26 of file ViewControlTest.php.
References $section, and getViewControlFactory().
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);
◆ test_render_viewcontrol_mode()
ViewControlTest::test_render_viewcontrol_mode |
( |
| ) |
|
Definition at line 115 of file ViewControlTest.php.
References $action, $active, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), getViewControlFactory(), and ILIAS_UI_TestBase\normalizeHTML().
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>";
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_viewcontrol_section()
ViewControlTest::test_render_viewcontrol_section |
( |
| ) |
|
Definition at line 71 of file ViewControlTest.php.
References $f, $html, $r, $section, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), getSectionExpectedHTML(), and getViewControlFactory().
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);
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_viewcontrol_get_actions()
ViewControlTest::test_viewcontrol_get_actions |
( |
| ) |
|
◆ test_viewcontrol_section_get_next_actions()
ViewControlTest::test_viewcontrol_section_get_next_actions |
( |
| ) |
|
Definition at line 58 of file ViewControlTest.php.
References $action, and getViewControlFactory().
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);
◆ test_viewcontrol_section_get_previous_actions()
ViewControlTest::test_viewcontrol_section_get_previous_actions |
( |
| ) |
|
Definition at line 45 of file ViewControlTest.php.
References $action, and getViewControlFactory().
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);
◆ test_viewcontrol_with_active()
ViewControlTest::test_viewcontrol_with_active |
( |
| ) |
|
Definition at line 99 of file ViewControlTest.php.
References $f, and getViewControlFactory().
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());
◆ $actions
ViewControlTest::$actions |
|
protected |
Initial value:= array(
"ILIAS" => "http://www.ilias.de",
"Github" => "http://www.github.com"
)
Definition at line 12 of file ViewControlTest.php.
◆ $active
ViewControlTest::$active = "Github" |
|
protected |
◆ $aria_label
ViewControlTest::$aria_label = "Mode View Controler" |
|
protected |
◆ $role
ViewControlTest::$role = "group" |
|
protected |
The documentation for this class was generated from the following file: