5 require_once(__DIR__ .
"/../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../Base.php");
8 use \ILIAS\UI\Component as
C;
18 return "Component Dummy";
33 return new \ILIAS\UI\Implementation\Component\Panel\Factory();
41 return new \ILIAS\UI\Implementation\Factory();
46 $f = $this->getPanelFactory();
48 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Panel\\Factory", $f);
49 $this->assertInstanceOf(
50 "ILIAS\\UI\\Component\\Panel\\Standard",
53 $this->assertInstanceOf(
54 "ILIAS\\UI\\Component\\Panel\\Sub",
57 $this->assertInstanceOf(
58 "ILIAS\\UI\\Component\\Panel\\Report",
65 $f = $this->getPanelFactory();
68 $this->assertEquals($p->getTitle(),
"Title");
73 $f = $this->getPanelFactory();
75 $p = $f->standard(
"Title",
array($c));
77 $this->assertEquals($p->getContent(),
array($c));
82 $fp = $this->getPanelFactory();
83 $f = $this->getFactory();
87 $actions = $f->dropdown()->standard(
array(
88 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
89 $f->button()->shy(
"GitHub",
"https://www.github.com")
92 $p = $p->withActions($actions);
94 $this->assertEquals($p->getActions(), $actions);
99 $fp = $this->getPanelFactory();
100 $f = $this->getFactory();
104 $actions = $f->dropdown()->standard(
array(
105 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
106 $f->button()->shy(
"GitHub",
"https://www.github.com")
109 $p = $p->withActions($actions);
111 $this->assertEquals($p->getActions(), $actions);
116 $fp = $this->getPanelFactory();
117 $f = $this->getFactory();
121 $card = $f->card(
"Card Title");
123 $p = $p->withCard($card);
125 $this->assertEquals($p->getCard(), $card);
130 $f = $this->getPanelFactory();
132 $p = $f->report(
"Title",
array($sub));
134 $this->assertEquals($p->getTitle(),
"Title");
139 $f = $this->getPanelFactory();
141 $p = $f->report(
"Title", $sub);
143 $this->assertEquals($p->getContent(),
array($sub));
149 $f = $this->getFactory();
150 $r = $this->getDefaultRenderer();
152 $actions = $f->dropdown()->standard(
array(
153 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
154 $f->button()->shy(
"GitHub",
"https://www.github.com")
157 $p = $f->panel()->standard(
"Title",
array())->withActions($actions);
161 $expected_html = <<<EOT
162 <div
class=
"panel panel-primary">
163 <div
class=
"panel-heading ilHeader clearfix">
164 <h3
class=
"ilHeader">
Title</h3>
165 <div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-haspopup=
"true" aria-expanded=
"false"> <span
class=
"caret"></span></button>
166 <ul
class=
"dropdown-menu">
167 <li><a
class=
"btn btn-link" href=
"https://www.ilias.de" data-action=
"https://www.ilias.de">
ILIAS</a></li>
168 <li><a
class=
"btn btn-link" href=
"https://www.github.com" data-action=
"https://www.github.com">GitHub</a></li>
172 <div
class=
"panel-body"></div>
175 $this->assertHTMLEquals($expected_html,
$html);
180 $f = $this->getFactory();
181 $fp = $this->getPanelFactory();
182 $r = $this->getDefaultRenderer();
184 $actions = $f->dropdown()->standard(
array(
185 $f->button()->shy(
"ILIAS",
"https://www.ilias.de"),
186 $f->button()->shy(
"GitHub",
"https://www.github.com")
189 $p = $fp->sub(
"Title",
array())->withActions($actions);
190 $card = $f->card(
"Card Title");
191 $p = $p->withCard($card);
194 $expected_html = <<<EOT
195 <div
class=
"panel panel-primary">
196 <div
class=
"panel-heading ilBlockHeader clearfix">
198 <div
class=
"dropdown"><button
class=
"btn btn-default dropdown-toggle" type=
"button" data-toggle=
"dropdown" aria-haspopup=
"true" aria-expanded=
"false"> <span
class=
"caret"></span></button>
199 <ul
class=
"dropdown-menu">
200 <li><a
class=
"btn btn-link" href=
"https://www.ilias.de" data-action=
"https://www.ilias.de">
ILIAS</a></li>
201 <li><a
class=
"btn btn-link" href=
"https://www.github.com" data-action=
"https://www.github.com">GitHub</a></li>
205 <div
class=
"panel-body">
207 <div
class=
"col-sm-8"></div>
208 <div
class=
"col-sm-4">
209 <div
class=
"il-card thumbnail">
210 <div
class=
"card-no-highlight"></div>
211 <div
class=
"caption">
221 $this->assertHTMLEquals($expected_html,
$html);
225 $f = $this->getFactory();
226 $fp = $this->getPanelFactory();
227 $r = $this->getDefaultRenderer();
228 $sub = $fp->sub(
"Title",
array());
229 $card = $f->card(
"Card Title");
230 $sub = $sub->withCard($card);
231 $report = $fp->report(
"Title", $sub);
236 "<div class=\"panel panel-primary il-panel-report\">" .
237 " <div class=\"panel-heading ilHeader\">" .
238 "<h3 class=\"ilHeader\">Title</h3>" .
240 " <div class=\"panel-body\">" .
242 <div class=\"panel panel-primary\">" .
243 " <div class=\"panel-heading ilBlockHeader clearfix\">" .
246 " <div class=\"panel-body\"><div class=\"row\">" .
247 " <div class=\"col-sm-8\"></div>" .
248 " <div class=\"col-sm-4\">" .
249 " <div class=\"il-card thumbnail\"><div class=\"card-no-highlight\"></div><div class=\"caption\"><h5 class=\"card-title\">Card Title</h5></div></div>" .
256 $this->assertHTMLEquals($expected_html,
$html);
test_implements_factory_interface()
test_standard_get_content()
test_standard_get_title()
Test on button implementation.
test_standard_with_actions()
if(!array_key_exists('StateId', $_REQUEST)) $id
A component is the most general form of an entity in the UI.
Provides common functionality for UI tests.
getCanonicalName()
Get the canonical name of the component.
Create styles array
The data for the language used.
test_report_get_content()