Test listing panels.
More...
Test listing panels.
Definition at line 14 of file PanelListingTest.php.
◆ getFactory()
PanelListingTest::getFactory |
( |
| ) |
|
◆ test_get_title_get_groups()
PanelListingTest::test_get_title_get_groups |
( |
| ) |
|
Definition at line 42 of file PanelListingTest.php.
43 {
45
46 $groups = array(
47 new I\Component\Item\Group(
"Subtitle 1", array(
48 new I\Component\Item\Standard(
"title1"),
49 new I\Component\Item\Standard(
"title2")
50 )),
51 new I\Component\Item\Group(
"Subtitle 2", array(
52 new I\Component\Item\Standard(
"title3")
53 ))
54 );
55
56 $c =
$f->standard(
"title", $groups);
57
58 $this->assertEquals(
$c->getTitle(),
"title");
59 $this->assertEquals(
$c->getItemGroups(), $groups);
60 }
References $c, $f, and getFactory().
◆ test_implements_factory_interface()
PanelListingTest::test_implements_factory_interface |
( |
| ) |
|
Definition at line 25 of file PanelListingTest.php.
26 {
28
29 $std_list =
$f->standard(
"List Title", array(
30 new I\Component\Item\Group(
"Subtitle 1", array(
31 new I\Component\Item\Standard(
"title1"),
32 new I\Component\Item\Standard(
"title2")
33 )),
34 new I\Component\Item\Group(
"Subtitle 2", array(
35 new I\Component\Item\Standard(
"title3")
36 ))
37 ));
38
39 $this->assertInstanceOf("ILIAS\\UI\\Component\\Panel\\Listing\\Standard", $std_list);
40 }
References $f, and getFactory().
◆ test_render_base()
PanelListingTest::test_render_base |
( |
| ) |
|
Definition at line 79 of file PanelListingTest.php.
80 {
83
84 $groups = array(
85 new I\Component\Item\Group(
"Subtitle 1", array(
86 new I\Component\Item\Standard(
"title1"),
87 new I\Component\Item\Standard(
"title2")
88 )),
89 new I\Component\Item\Group(
"Subtitle 2", array(
90 new I\Component\Item\Standard(
"title3")
91 ))
92 );
93
94 $c =
$f->standard(
"title", $groups);
95
97
98 $expected = <<<EOT
99<div class="il-panel-listing-std-container clearfix">
100 <h3>title</h3>
101 <div class="il-item-group">
102 <h4>Subtitle 1</h4>
103 <div class="il-item-group-items">
104 <div class="il-panel-listing-std-item-container"><div class="il-item il-std-item ">
105 <h5>title1</h5>
106 </div></div><div class="il-panel-listing-std-item-container"><div class="il-item il-std-item ">
107 <h5>title2</h5>
108 </div></div>
109 </div>
110 </div><div class="il-item-group">
111 <h4>Subtitle 2</h4>
112 <div class="il-item-group-items">
113 <div class="il-panel-listing-std-item-container"><div class="il-item il-std-item ">
114 <h5>title3</h5>
115 </div></div>
116 </div>
117</div>
118</div>
119EOT;
121 }
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()
PanelListingTest::test_render_with_actions |
( |
| ) |
|
Definition at line 123 of file PanelListingTest.php.
124 {
127
128 $groups = array();
129
130 $actions = new I\Component\Dropdown\Standard(array(
131 new I\Component\
Button\Shy(
"ILIAS",
"https://www.ilias.de"),
132 new I\Component\
Button\Shy(
"GitHub",
"https://www.github.com")
133 ));
134
135 $c =
$f->standard(
"title", $groups)
136 ->withActions($actions);
137
139
140 $expected = <<<EOT
141<div class="il-panel-listing-std-container clearfix">
142<h3>title</h3><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>
143<ul class="dropdown-menu">
144 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1">
ILIAS</button></li>
145 <li><button
class=
"btn btn-link" data-action=
"https://www.github.com" id=
"id_2">GitHub</button></li>
146</ul>
147</div>
148</div>
149EOT;
151 }
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), data, ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
◆ test_with_actions()
PanelListingTest::test_with_actions |
( |
| ) |
|
Definition at line 62 of file PanelListingTest.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
71 $groups = array();
72
73 $c =
$f->standard(
"title", $groups)
74 ->withActions($actions);
75
76 $this->assertEquals(
$c->getActions(), $actions);
77 }
References $c, $f, and getFactory().
The documentation for this class was generated from the following file: