Test on card implementation.
More...
Test on card implementation.
Definition at line 30 of file DropdownTest.php.
◆ getFactory()
DropdownTest::getFactory |
( |
| ) |
|
|
protected |
◆ testImplementsFactoryInterface()
DropdownTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testRenderEmpty()
DropdownTest::testRenderEmpty |
( |
| ) |
|
Definition at line 71 of file DropdownTest.php.
71 : void
72 {
74 $r = $this->getDefaultRenderer();
75
76 $c =
$f->standard(array());
77
78 $html = $r->render(
$c);
79 $expected = "";
80
81 $this->assertEquals($expected, $html);
82 }
References $c, Vendor\Package\$f, and getFactory().
◆ testRenderItems()
DropdownTest::testRenderItems |
( |
| ) |
|
Definition at line 84 of file DropdownTest.php.
84 : void
85 {
87 $r = $this->getDefaultRenderer();
88
89 $c =
$f->standard(array(
93 ));
94
95 $html = $r->render(
$c);
96
97 $expected = <<<EOT
98 <div class="dropdown" id="id_3">
99 <
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu">
100 <span class="caret"></span>
102 <ul id="id_3_menu" class="dropdown-menu">
103 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</
button></li>
104 <li><hr /></li>
105 <li><
button class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</
button></li>
106 </ul>
107 </div>
108EOT;
109
110 $this->assertHTMLEquals($expected, $html);
111 }
button(string $caption, string $cmd)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
References $c, Vendor\Package\$f, ILIAS\Repository\button(), and getFactory().
◆ testRenderItemsWithAriaLabel()
DropdownTest::testRenderItemsWithAriaLabel |
( |
| ) |
|
Definition at line 163 of file DropdownTest.php.
163 : void
164 {
166 $r = $this->getDefaultRenderer();
167
168 $c =
$f->standard(array(
172 ))->withLabel("label")->withAriaLabel("my_aria_label");
173
174 $html = $r->render(
$c);
175
176 $expected = <<<EOT
177 <div
class=
"dropdown" id=
"id_3"><
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-label=
"my_aria_label" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu">label<span
class=
"caret"></span></
button>
178 <ul id="id_3_menu" class="dropdown-menu">
179 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</
button></li>
180 <li><hr /></li>
181 <li><
button class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</
button></li>
182 </ul>
183 </div>
184EOT;
185
186 $this->assertHTMLEquals($expected, $html);
187 }
References $c, Vendor\Package\$f, ILIAS\Repository\button(), and getFactory().
◆ testRenderItemsWithLabel()
DropdownTest::testRenderItemsWithLabel |
( |
| ) |
|
Definition at line 113 of file DropdownTest.php.
113 : void
114 {
116 $r = $this->getDefaultRenderer();
117
118 $c =
$f->standard(array(
122 ))->withLabel("label");
123
124 $html = $r->render(
$c);
125
126 $expected = <<<EOT
127 <div
class=
"dropdown" id=
"id_3"><
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_3_menu">label<span
class=
"caret"></span></
button>
128 <ul id="id_3_menu" class="dropdown-menu">
129 <li><
button class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</
button></li>
130 <li><hr /></li>
131 <li><
button class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</
button></li>
132 </ul>
133 </div>
134EOT;
135
136 $this->assertHTMLEquals($expected, $html);
137 }
References $c, Vendor\Package\$f, ILIAS\Repository\button(), and getFactory().
◆ testRenderWithLinkNewViewport()
DropdownTest::testRenderWithLinkNewViewport |
( |
| ) |
|
Definition at line 139 of file DropdownTest.php.
139 : void
140 {
142 $r = $this->getDefaultRenderer();
143
144 $link = new I\Component\Link\Standard("Link to ILIAS", "http://www.ilias.de");
145
146 $c =
$f->standard(array(
147 $link->withOpenInNewViewport(true)
148 ));
149
150 $html = $r->render(
$c);
151
152 $expected = <<<EOT
153 <div
class=
"dropdown" id=
"id_1"><
button class=
"btn btn-default dropdown-toggle" type=
"button" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false" aria-controls=
"id_1_menu"><span
class=
"caret"></span></
button>
154 <ul id="id_1_menu" class="dropdown-menu">
155 <li><a href=
"http://www.ilias.de" target=
"_blank" rel=
"noopener">Link
to ILIAS</a></li>
156 </ul>
157 </div>
158EOT;
159
160 $this->assertHTMLEquals($expected, $html);
161 }
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.
References $c, Vendor\Package\$f, ILIAS\Repository\button(), getFactory(), and ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\to().
◆ testWithItems()
DropdownTest::testWithItems |
( |
| ) |
|
Definition at line 53 of file DropdownTest.php.
53 : void
54 {
56 $link = new I\Component\Link\Standard("Link to Github", "http://www.github.com");
57 $c =
$f->standard(array(
61 $link->withOpenInNewViewport(true)
62 ));
63 $items =
$c->getItems();
64
65 $this->assertTrue(is_array($items));
66 $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Shy", $items[0]);
67 $this->assertInstanceOf("ILIAS\\UI\\Component\\Divider\\Horizontal", $items[2]);
68 $this->assertInstanceOf("ILIAS\\UI\\Component\\Link\\Standard", $items[3]);
69 }
References $c, Vendor\Package\$f, and getFactory().
◆ testWithLabel()
DropdownTest::testWithLabel |
( |
| ) |
|
The documentation for this class was generated from the following file: