Tests for the Slate.
More...
Tests for the Slate.
Definition at line 31 of file CombinedSlateTest.php.
◆ getUIFactory()
CombinedSlateTest::getUIFactory |
( |
| ) |
|
◆ 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 67 of file CombinedSlateTest.php.
References $r.
70 $icon = $this->icon_factory->custom(
'',
'');
71 $slate =
new Combined($this->sig_gen, $name, $icon);
73 $r = $this->getDefaultRenderer();
74 $html =
$r->render($slate);
76 $expected =
'<div class="il-maincontrols-slate disengaged" id="id_1"><div class="il-maincontrols-slate-content" data-replace-marker="content"></div></div>';
79 $this->brutallyTrimHTML($html)
◆ testRenderingWithAriaRole()
CombinedSlateTest::testRenderingWithAriaRole |
( |
| ) |
|
Definition at line 83 of file CombinedSlateTest.php.
References $r.
86 $icon = $this->icon_factory->custom(
'',
'');
87 $slate =
new Combined($this->sig_gen, $name, $icon);
88 $slate = $slate->withAriaRole(
I\MainControls\Slate\Slate::MENU);
90 $r = $this->getDefaultRenderer();
91 $html =
$r->render($slate);
93 $expected =
'<div class="il-maincontrols-slate disengaged" id="id_1" role="menu"><div class="il-maincontrols-slate-content" data-replace-marker="content"></div></div>';
96 $this->brutallyTrimHTML($html)
◆ testRenderingWithSubDivider()
CombinedSlateTest::testRenderingWithSubDivider |
( |
| ) |
|
Definition at line 100 of file CombinedSlateTest.php.
References $r.
103 $icon = $this->icon_factory->custom(
'',
'');
104 $subdivider =
new I\Divider\Horizontal();
105 $subdivider_with_text =
new I\Divider\Horizontal();
106 $subdivider_with_text = $subdivider_with_text->withLabel(
'Title');
107 $slate =
new Combined($this->sig_gen, $name, $icon);
109 ->withAdditionalEntry($subdivider_with_text)
110 ->withAdditionalEntry($subdivider);
112 $r = $this->getDefaultRenderer();
113 $html =
$r->render($slate);
116 <div
class=
"il-maincontrols-slate disengaged" id=
"id_1">
117 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content">
119 <li><hr
class=
"il-divider-with-label" /><h4
class=
"il-divider">
Title</h4></li>
126 $this->brutallyTrimHTML($expected),
127 $this->brutallyTrimHTML($html)
◆ testRenderingWithSubslateAndButton()
CombinedSlateTest::testRenderingWithSubslateAndButton |
( |
| ) |
|
Definition at line 131 of file CombinedSlateTest.php.
References $r, and ILIAS\Repository\button().
133 $icon = $this->icon_factory->custom(
'',
'');
134 $subslate =
new Combined($this->sig_gen,
'subslate_name', $icon);
135 $subbutton = $this->button_factory->bulky($icon,
'button_name',
'');
136 $slate =
new Combined($this->sig_gen,
'slate_name', $icon);
138 ->withAdditionalEntry($subslate)
139 ->withAdditionalEntry($subbutton);
141 $r = $this->getDefaultRenderer();
142 $html =
$r->render($slate);
145 <div
class=
"il-maincontrols-slate disengaged" id=
"id_3">
146 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content">
149 <
button class=
"btn btn-bulky" id=
"id_1">
150 <img
class=
"icon custom small" src=
"" alt=
""/>
151 <span
class=
"bulky-label">subslate_name</span>
153 <div
class=
"il-maincontrols-slate disengaged" id=
"id_2">
154 <div
class=
"il-maincontrols-slate-content" data-replace-marker=
"content"></div>
158 <button
class=
"btn btn-bulky" data-action=
"">
159 <img
class=
"icon custom small" src=
"" alt=
""/>
160 <span
class=
"bulky-label">button_name</span>
168 $this->brutallyTrimHTML($expected),
169 $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: