Test on card implementation.
More...
Test on card implementation.
Definition at line 14 of file DropdownTest.php.
◆ getFactory()
DropdownTest::getFactory |
( |
| ) |
|
|
protected |
◆ test_implements_factory_interface()
DropdownTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 21 of file DropdownTest.php.
22 {
24
25 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Dropdown\\Standard",
$f->standard(array()));
26 }
References $f, and getFactory().
◆ test_render_empty()
DropdownTest::test_render_empty |
( |
| ) |
|
◆ test_render_items()
DropdownTest::test_render_items |
( |
| ) |
|
Definition at line 66 of file DropdownTest.php.
67 {
70
71 $c =
$f->standard(array(
72 new I\Component\
Button\Shy(
"ILIAS",
"https://www.ilias.de"),
73 new I\Component\Divider\Horizontal(),
74 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com")
75 ));
76
78
79 $expected = <<<EOT
80 <div class="dropdown">
81 <button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false">
82 <span class="caret"></span>
83 </button>
84 <ul class="dropdown-menu">
85 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
86 <li><hr /></li>
87 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
88 </ul>
89 </div>
90EOT;
91
93 }
assertHTMLEquals($expected_html_as_string, $html_as_string)
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), data, ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
◆ test_render_items_with_aria_label()
DropdownTest::test_render_items_with_aria_label |
( |
| ) |
|
Definition at line 121 of file DropdownTest.php.
122 {
125
126 $c =
$f->standard(array(
127 new I\Component\
Button\Shy(
"ILIAS",
"https://www.ilias.de"),
128 new I\Component\Divider\Horizontal(),
129 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com")
130 ))->withLabel("label")->withAriaLabel("my_aria_label");
131
133
134 $expected = <<<EOT
135 <div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-label=
"my_aria_label" aria-haspopup=
"true" aria-expanded=
"false">label <span
class=
"caret"></span></button>
136 <ul class="dropdown-menu">
137 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
138 <li><hr /></li>
139 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
140 </ul>
141 </div>
142EOT;
143
145 }
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), data, ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
◆ test_render_items_with_label()
DropdownTest::test_render_items_with_label |
( |
| ) |
|
Definition at line 95 of file DropdownTest.php.
96 {
99
100 $c =
$f->standard(array(
101 new I\Component\
Button\Shy(
"ILIAS",
"https://www.ilias.de"),
102 new I\Component\Divider\Horizontal(),
103 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com")
104 ))->withLabel("label");
105
107
108 $expected = <<<EOT
109 <div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-haspopup=
"true" aria-expanded=
"false">label <span
class=
"caret"></span></button>
110 <ul class="dropdown-menu">
111 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
112 <li><hr /></li>
113 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
114 </ul>
115 </div>
116EOT;
117
119 }
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), data, ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
◆ test_with_items()
DropdownTest::test_with_items |
( |
| ) |
|
Definition at line 37 of file DropdownTest.php.
38 {
40 $c =
$f->standard(array(
41 new I\Component\
Button\Shy(
"ILIAS",
"https://www.ilias.de"),
42 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com"),
43 new I\Component\Divider\Horizontal(),
44 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com")
45 ));
46 $items =
$c->getItems();
47
48 $this->assertTrue(is_array($items));
49 $this->assertInstanceOf("ILIAS\\UI\\Component\\Button\\Shy", $items[0]);
50 $this->assertInstanceOf("ILIAS\\UI\\Component\\Divider\\Horizontal", $items[2]);
51 }
References $c, $f, and getFactory().
◆ test_with_label()
DropdownTest::test_with_label |
( |
| ) |
|
Definition at line 28 of file DropdownTest.php.
29 {
31
32 $c =
$f->standard(array())->withLabel(
"label");
33
34 $this->assertEquals(
$c->getLabel(),
"label");
35 }
References $c, $f, and getFactory().
The documentation for this class was generated from the following file: