Tests for the Slate.
More...
Tests for the Slate.
Definition at line 31 of file CombinedSlateTest.php.
◆ getUIFactory()
| CombinedSlateTest::getUIFactory |
( |
| ) |
|
Definition at line 46 of file CombinedSlateTest.php.
References $button_factory, $sig_gen, and ILIAS\Repository\button().
56 public function glyph():
C\Symbol\Glyph\Factory
58 return new I\Symbol\Glyph\Factory();
61 public function divider():
C\Divider\Factory
63 return new I\Divider\Factory();
66 public function mainControls():
C\MainControls\Factory
68 return new I\MainControls\Factory($this->sig_gen);
button(string $caption, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
I SignalGenerator $sig_gen
I Button Factory $button_factory
◆ setUp()
| CombinedSlateTest::setUp |
( |
| ) |
|
Definition at line 38 of file CombinedSlateTest.php.
40 $this->sig_gen =
new I\SignalGenerator();
41 $this->button_factory =
new I\Button\Factory();
42 $this->divider_factory =
new I\Divider\Factory();
43 $this->icon_factory =
new I\Symbol\Icon\Factory();
◆ testRendering()
| CombinedSlateTest::testRendering |
( |
| ) |
|
Definition at line 76 of file CombinedSlateTest.php.
References $r.
79 $icon = $this->icon_factory->custom(
'',
'');
80 $slate =
new Combined($this->sig_gen, $name, $icon);
82 $r = $this->getDefaultRenderer();
83 $html =
$r->render($slate);
85 $expected =
'<div class="il-maincontrols-slate disengaged" id="id_1"><div class="il-maincontrols-slate-content" data-replace-marker="content"></div></div>';
88 $this->brutallyTrimHTML($html)
◆ testRenderingWithAriaRole()
| CombinedSlateTest::testRenderingWithAriaRole |
( |
| ) |
|
Definition at line 92 of file CombinedSlateTest.php.
References $r.
95 $icon = $this->icon_factory->custom(
'',
'');
96 $slate =
new Combined($this->sig_gen, $name, $icon);
97 $slate = $slate->withAriaRole(
I\MainControls\Slate\Slate::MENU);
99 $r = $this->getDefaultRenderer();
100 $html =
$r->render($slate);
102 $expected =
'<div class="il-maincontrols-slate disengaged" id="id_1" role="menu"><div class="il-maincontrols-slate-content" data-replace-marker="content"></div></div>';
105 $this->brutallyTrimHTML($html)
◆ testRenderingWithSubDivider()
| CombinedSlateTest::testRenderingWithSubDivider |
( |
| ) |
|
Definition at line 109 of file CombinedSlateTest.php.
References $r.
112 $icon = $this->icon_factory->custom(
'',
'');
113 $subdivider =
new I\Divider\Horizontal();
114 $subdivider_with_text =
new I\Divider\Horizontal();
115 $subdivider_with_text = $subdivider_with_text->withLabel(
'Title');
116 $slate =
new Combined($this->sig_gen, $name, $icon);
118 ->withAdditionalEntry($subdivider_with_text)
119 ->withAdditionalEntry($subdivider);
121 $r = $this->getDefaultRenderer();
122 $html =
$r->render($slate);
125 <div
class=
"il-maincontrols-slate disengaged" id=
"id_1">
126 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content">
128 <li><hr
class=
"il-divider-with-label" /><h4
class=
"il-divider">
Title</h4></li>
135 $this->brutallyTrimHTML($expected),
136 $this->brutallyTrimHTML($html)
◆ testRenderingWithSubslateAndButton()
| CombinedSlateTest::testRenderingWithSubslateAndButton |
( |
| ) |
|
Definition at line 140 of file CombinedSlateTest.php.
References $r, and ILIAS\Repository\button().
142 $icon = $this->icon_factory->custom(
'',
'');
143 $subslate =
new Combined($this->sig_gen,
'subslate_name', $icon);
144 $subbutton = $this->button_factory->bulky($icon,
'button_name',
'');
145 $slate =
new Combined($this->sig_gen,
'slate_name', $icon);
147 ->withAdditionalEntry($subslate)
148 ->withAdditionalEntry($subbutton);
150 $r = $this->getDefaultRenderer();
151 $html =
$r->render($slate);
154 <div
class=
"il-maincontrols-slate disengaged" id=
"id_3">
155 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content">
158 <
button class=
"btn btn-bulky" id=
"id_1">
159 <img
class=
"icon custom small" src=
"" alt=
""/>
160 <span
class=
"bulky-label">subslate_name</span>
162 <div
class=
"il-maincontrols-slate disengaged" id=
"id_2">
163 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content"></div>
167 <button
class=
"btn btn-bulky" data-action=
"">
168 <img
class=
"icon custom small" src=
"" alt=
""/>
169 <span
class=
"bulky-label">button_name</span>
177 $this->brutallyTrimHTML($expected),
178 $this->brutallyTrimHTML($html)
button(string $caption, string $cmd)
◆ $button_factory
| I Button Factory CombinedSlateTest::$button_factory |
|
protected |
◆ $divider_factory
| I Divider Factory CombinedSlateTest::$divider_factory |
|
protected |
◆ $icon_factory
| I Symbol Icon Factory CombinedSlateTest::$icon_factory |
|
protected |
◆ $sig_gen
| I SignalGenerator CombinedSlateTest::$sig_gen |
|
protected |
The documentation for this class was generated from the following file: