Test items groups.
More...
Test items groups.
Definition at line 14 of file ItemGroupTest.php.
◆ getFactory()
ItemGroupTest::getFactory |
( |
| ) |
|
◆ test_get_items()
ItemGroupTest::test_get_items |
( |
| ) |
|
Definition at line 48 of file ItemGroupTest.php.
49 {
51
52 $items = array(
53 $f->standard(
"title1"),
54 $f->standard(
"title2")
55 );
56
57 $c =
$f->group(
"group", $items);
58
59 $this->assertEquals(
$c->getItems(), $items);
60 }
References $c, $f, and getFactory().
◆ test_get_title()
ItemGroupTest::test_get_title |
( |
| ) |
|
Definition at line 37 of file ItemGroupTest.php.
38 {
40 $c =
$f->group(
"group", array(
41 $f->standard(
"title1"),
42 $f->standard(
"title2")
43 ));
44
45 $this->assertEquals(
$c->getTitle(),
"group");
46 }
References $c, $f, and getFactory().
◆ test_implements_factory_interface()
ItemGroupTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 25 of file ItemGroupTest.php.
26 {
28
29 $group =
$f->group(
"group", array(
30 $f->standard(
"title1"),
31 $f->standard(
"title2")
32 ));
33
34 $this->assertInstanceOf("ILIAS\\UI\\Component\\Item\\Group", $group);
35 }
References $f, and getFactory().
◆ test_render_base()
ItemGroupTest::test_render_base |
( |
| ) |
|
Definition at line 80 of file ItemGroupTest.php.
81 {
84
85 $items = array(
86 $f->standard(
"title1"),
87 $f->standard(
"title2")
88 );
89
90 $c =
$f->group(
"group", $items);
91
93
94 $expected = <<<EOT
95<div class="il-item-group">
96 <h4>group</h4>
97 <div class="il-item-group-items">
98 <div class="il-panel-listing-std-item-container"><div class="il-item il-std-item ">
99 <h5>title1</h5>
100 </div></div><div class="il-panel-listing-std-item-container"><div class="il-item il-std-item ">
101 <h5>title2</h5>
102 </div></div>
103 </div>
104</div>
105EOT;
107 }
assertHTMLEquals($expected_html_as_string, $html_as_string)
getDefaultRenderer(JavaScriptBinding $js_binding=null)
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
◆ test_render_with_actions()
ItemGroupTest::test_render_with_actions |
( |
| ) |
|
Definition at line 109 of file ItemGroupTest.php.
110 {
113
114 $actions = new I\Component\Dropdown\Standard(array(
115 new I\Component\
Button\Shy(
"ILIAS",
"https://www.ilias.de"),
116 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com")
117 ));
118 $items = array(
119 $f->standard(
"title1"),
120 $f->standard(
"title2")
121 );
122
123 $c =
$f->group(
"group", $items)->withActions($actions);
124
126
127 $expected = <<<EOT
128<div class="il-item-group">
129<h4>group</h4><div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-label=
"actions" aria-haspopup=
"true" aria-expanded=
"false"> <span
class=
"caret"></span></button>
130 <ul class="dropdown-menu">
131 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
132 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
133 </ul>
134 </div>
135 <div class="il-item-group-items">
136 <div class="il-panel-listing-std-item-container"><div class="il-item il-std-item ">
137 <h5>title1</h5>
138 </div></div><div class="il-panel-listing-std-item-container"><div class="il-item il-std-item ">
139 <h5>title2</h5>
140 </div></div>
141 </div>
142</div>
143EOT;
145 }
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), data, ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
◆ test_with_actions()
ItemGroupTest::test_with_actions |
( |
| ) |
|
Definition at line 62 of file ItemGroupTest.php.
63 {
65
66 $actions = new I\Component\Dropdown\Standard(array(
67 new I\Component\
Button\Shy(
"ILIAS",
"https://www.ilias.de"),
68 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com")
69 ));
70 $items = array(
71 $f->standard(
"title1"),
72 $f->standard(
"title2")
73 );
74
75 $c =
$f->group(
"group", $items)->withActions($actions);
76
77 $this->assertEquals(
$c->getActions(), $actions);
78 }
References $c, $f, and getFactory().
The documentation for this class was generated from the following file: