ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
StandardFilterTest Class Reference

Test on standard filter implementation. More...

+ Inheritance diagram for StandardFilterTest:
+ Collaboration diagram for StandardFilterTest:

Public Member Functions

 getUIFactory ()
 
 testRenderActivatedCollapsed ()
 
 testRenderDeactivatedCollapsed ()
 
 testRenderActivatedExpanded ()
 
 testRenderDeactivatedExpanded ()
 
 testDedicatedNames ()
 

Protected Member Functions

 buildFactory ()
 
 buildInputFactory ()
 
 buildButtonFactory ()
 
 buildSymbolFactory ()
 
 buildPopoverFactory ()
 
 buildLegacyFactory ()
 
 buildListingFactory ()
 

Detailed Description

Test on standard filter implementation.

Definition at line 80 of file StandardFilterTest.php.

Member Function Documentation

◆ buildButtonFactory()

StandardFilterTest::buildButtonFactory ( )
protected

Definition at line 104 of file StandardFilterTest.php.

104 : I\Button\Factory
105 {
106 return new I\Button\Factory();
107 }

Referenced by getUIFactory().

+ Here is the caller graph for this function:

◆ buildFactory()

StandardFilterTest::buildFactory ( )
protected

Definition at line 82 of file StandardFilterTest.php.

82 : I\Input\Container\Filter\Factory
83 {
84 return new I\Input\Container\Filter\Factory(
85 new I\SignalGenerator(),
86 $this->buildInputFactory()
87 );
88 }

References buildInputFactory().

Referenced by testDedicatedNames(), testRenderActivatedCollapsed(), testRenderActivatedExpanded(), testRenderDeactivatedCollapsed(), and testRenderDeactivatedExpanded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildInputFactory()

StandardFilterTest::buildInputFactory ( )
protected

Definition at line 90 of file StandardFilterTest.php.

90 : I\Input\Field\Factory
91 {
92 $df = new Data\Factory();
93 $language = $this->createMock(ILIAS\Language\Language::class);
94 return new I\Input\Field\Factory(
95 $this->createMock(\ILIAS\UI\Implementation\Component\Input\Field\Node\Factory::class),
96 $this->createMock(\ILIAS\UI\Implementation\Component\Input\UploadLimitResolver::class),
97 new I\SignalGenerator(),
98 $df,
99 new ILIAS\Refinery\Factory($df, $language),
100 $language
101 );
102 }
Builds data types.
Definition: Factory.php:36
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

Referenced by buildFactory(), testDedicatedNames(), testRenderActivatedCollapsed(), testRenderActivatedExpanded(), testRenderDeactivatedCollapsed(), and testRenderDeactivatedExpanded().

+ Here is the caller graph for this function:

◆ buildLegacyFactory()

StandardFilterTest::buildLegacyFactory ( )
protected

Definition at line 123 of file StandardFilterTest.php.

123 : I\Legacy\Factory
124 {
125 $mock = $this->createMock(I\Legacy\Factory::class);
126 $mock->method('content')->willReturn(
127 new I\Legacy\Content('', new I\SignalGenerator())
128 );
129 return $mock;
130 }

Referenced by getUIFactory().

+ Here is the caller graph for this function:

◆ buildListingFactory()

StandardFilterTest::buildListingFactory ( )
protected

Definition at line 132 of file StandardFilterTest.php.

132 : I\Listing\Factory
133 {
134 return new I\Listing\Factory(
135 new I\Listing\Workflow\Factory(),
136 new I\Listing\CharacteristicValue\Factory(),
137 new I\Listing\Entity\Factory(),
138 );
139 }

Referenced by getUIFactory().

+ Here is the caller graph for this function:

◆ buildPopoverFactory()

StandardFilterTest::buildPopoverFactory ( )
protected

Definition at line 118 of file StandardFilterTest.php.

118 : I\Popover\Factory
119 {
120 return new I\Popover\Factory(new I\SignalGenerator());
121 }

Referenced by getUIFactory().

+ Here is the caller graph for this function:

◆ buildSymbolFactory()

StandardFilterTest::buildSymbolFactory ( )
protected

Definition at line 109 of file StandardFilterTest.php.

109 : I\Symbol\Factory
110 {
111 return new I\Symbol\Factory(
112 new I\Symbol\Icon\Factory(),
113 new I\Symbol\Glyph\Factory(),
114 new I\Symbol\Avatar\Factory()
115 );
116 }

Referenced by getUIFactory().

+ Here is the caller graph for this function:

◆ getUIFactory()

StandardFilterTest::getUIFactory ( )

◆ testDedicatedNames()

StandardFilterTest::testDedicatedNames ( )

Definition at line 704 of file StandardFilterTest.php.

704 : void
705 {
706 $f = $this->buildFactory();
707 $if = $this->buildInputFactory();
708 $inputs = [
709 $if->text("Title")->withDedicatedName('title'),
710 $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"])->withDedicatedName('selection'),
711 $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
712 ];
713 $filter = $f->standard(
714 "#",
715 "#",
716 "#",
717 "#",
718 "#",
719 "#",
720 $inputs,
721 [true, true, true],
722 true,
723 true
724 );
725
726 $inputs = $filter->getInputs();
727 $this->assertEquals('filter_input_0/title', $inputs[0]->getName());
728 $this->assertEquals('filter_input_0/selection', $inputs[1]->getName());
729 $this->assertEquals('filter_input_0/filter_input_1', $inputs[2]->getName());
730 }

References Vendor\Package\$f, ILIAS\UI\Implementation\Component\Input\$inputs, buildFactory(), and buildInputFactory().

+ Here is the call graph for this function:

◆ testRenderActivatedCollapsed()

StandardFilterTest::testRenderActivatedCollapsed ( )

Definition at line 152 of file StandardFilterTest.php.

152 : void
153 {
154 $f = $this->buildFactory();
155 $if = $this->buildInputFactory();
156 $inputs = [
157 $if->text("Title"),
158 $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
159 $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
160 ];
161 $inputs_rendered = [true, false, true];
162
163 $filter = $f->standard(
164 "#",
165 "#",
166 "#",
167 "#",
168 "#",
169 "#",
170 $inputs,
171 $inputs_rendered,
172 true,
173 false
174 );
175
176 $r = $this->getDefaultRenderer();
177 $html = $r->render($filter);
178
179 $expected = <<<EOT
180<div class="il-filter enabled" id="id_1">
181 <form class="c-form il-standard-form form-horizontal" enctype="multipart/form-data" method="get" data-cmd-expand="#" data-cmd-collapse="#" data-cmd-apply="#" data-cmd-toggleOn="#" data-cmd-toggleOff="#">
182 <div class="il-filter-bar">
183 <div class="il-filter-bar-opener">
184 <button type="button" aria-expanded="false" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
185 <span>
186 <span data-collapse-glyph-visibility="0">
187 <a class="glyph" aria-label="collapse_content">
188 <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
189 </a>
190 </span>
191 <span data-expand-glyph-visibility="1">
192 <a class="glyph" aria-label="expand_content">
193 <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
194 </a>
195 </span> filter
196 </span>
197 </button>
198 </div>
199 <div class="il-filter-bar-toggle">
200 <div class="il-toggle-item">
201 <button class="il-toggle-button on" id="id_4" aria-pressed="false">
202 <span class="il-toggle-label-on">toggle_on</span>
203 <span class="il-toggle-label-off">toggle_off</span>
204 <span class="il-toggle-switch"></span>
205 </button>
206 </div>
207 </div>
208 </div>
209 <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="1">
210 <span id="1"></span>
211 <span id="2"></span>
212 <span id="3"></span>
213 </div>
214 <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="0">
215 <div class="col-md-6 col-lg-4 il-popover-container">
216 <div class="input-group">
217 <label for="id_5" class="input-group-addon leftaddon">Title</label>
218 <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
219 <span class="input-group-addon rightaddon">
220 <a class="glyph" href="" aria-label="remove" id="id_6">
221 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
222 </a>
223 </span>
224 </div>
225 </div>
226 <div class="col-md-6 col-lg-4 il-popover-container">
227 <div class="input-group">
228 <label for="id_7" class="input-group-addon leftaddon">Selection</label>
229 <select id="id_7" name="filter_input_0/filter_input_2">
230 <option selected="selected" value="">-</option>
231 <option value="one">One</option>
232 <option value="two">Two</option>
233 <option value="three">Three</option>
234 </select>
235 <span class="input-group-addon rightaddon">
236 <a class="glyph" href="" aria-label="remove" id="id_8">
237 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
238 </a>
239 </span>
240 </div>
241 </div>
242 <div class="col-md-6 col-lg-4 il-popover-container">
243 <div class="input-group">
244 <label class="input-group-addon leftaddon">Multi Selection</label>
245 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
246 <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
247 <span class="input-group-addon rightaddon">
248 <a class="glyph" href="" aria-label="remove" id="id_12">
249 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
250 </a>
251 </span>
252 </div>
253 </div>
254 <div class="col-md-6 col-lg-4 il-popover-container">
255 <div class="input-group">
256 <button class="btn btn-bulky" id="id_18">
257 <span class="glyph" aria-label="add" role="img">
258 <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
259 </span>
260 <span class="bulky-label"></span>
261 </button>
262 </div>
263 <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
264 </div>
265 <div class="il-filter-controls">
266 <button class="btn btn-bulky" data-action="" id="id_2">
267 <span class="glyph" role="img">
268 <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
269 </span>
270 <span class="bulky-label">apply</span>
271 </button>
272 <button class="btn btn-bulky" data-action="#" id="id_3">
273 <span class="glyph" role="img">
274 <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
275 </span>
276 <span class="bulky-label">reset</span>
277 </button>
278 </div>
279 </div>
280 <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
281 <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
282 <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
283 </form>
284</div>
285EOT;
286
287 $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
288 }
Title class.
Definition: Title.php:42
form( $class_path, string $cmd, string $submit_caption="")
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
button(string $caption, string $cmd)

References Vendor\Package\$f, ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\UI\examples\Symbol\Glyph\Apply\apply(), buildFactory(), buildInputFactory(), ILIAS\Repository\button(), ILIAS\UI\examples\Symbol\Glyph\Collapse\collapse(), ILIAS\UI\examples\Symbol\Glyph\Expand\expand(), ILIAS\Repository\filter(), and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ testRenderActivatedExpanded()

StandardFilterTest::testRenderActivatedExpanded ( )

Definition at line 428 of file StandardFilterTest.php.

428 : void
429 {
430 $f = $this->buildFactory();
431 $if = $this->buildInputFactory();
432 $inputs = [
433 $if->text("Title"),
434 $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
435 $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
436 ];
437 $inputs_rendered = [true, false, true];
438
439 $filter = $f->standard(
440 "#",
441 "#",
442 "#",
443 "#",
444 "#",
445 "#",
446 $inputs,
447 $inputs_rendered,
448 true,
449 true
450 );
451
452 $r = $this->getDefaultRenderer();
453 $html = $r->render($filter);
454
455 $expected = <<<EOT
456<div class="il-filter enabled" id="id_1">
457 <form class="c-form il-standard-form form-horizontal" enctype="multipart/form-data" method="get" data-cmd-expand="#" data-cmd-collapse="#" data-cmd-apply="#" data-cmd-toggleOn="#" data-cmd-toggleOff="#">
458 <div class="il-filter-bar">
459 <div class="il-filter-bar-opener">
460 <button type="button" aria-expanded="true" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
461 <span>
462 <span data-collapse-glyph-visibility="1">
463 <a class="glyph" aria-label="collapse_content">
464 <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
465 </a>
466 </span>
467 <span data-expand-glyph-visibility="0">
468 <a class="glyph" aria-label="expand_content">
469 <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
470 </a>
471 </span> filter
472 </span>
473 </button>
474 </div>
475 <div class="il-filter-bar-toggle">
476 <div class="il-toggle-item">
477 <button class="il-toggle-button on" id="id_4" aria-pressed="false">
478 <span class="il-toggle-label-on">toggle_on</span>
479 <span class="il-toggle-label-off">toggle_off</span>
480 <span class="il-toggle-switch"></span>
481 </button>
482 </div>
483 </div>
484 </div>
485 <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="0">
486 <span id="1"></span>
487 <span id="2"></span>
488 <span id="3"></span>
489 </div>
490 <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="1">
491 <div class="col-md-6 col-lg-4 il-popover-container">
492 <div class="input-group">
493 <label for="id_5" class="input-group-addon leftaddon">Title</label>
494 <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
495 <span class="input-group-addon rightaddon">
496 <a class="glyph" href="" aria-label="remove" id="id_6">
497 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
498 </a>
499 </span>
500 </div>
501 </div>
502 <div class="col-md-6 col-lg-4 il-popover-container">
503 <div class="input-group">
504 <label for="id_7" class="input-group-addon leftaddon">Selection</label>
505 <select id="id_7" name="filter_input_0/filter_input_2">
506 <option selected="selected" value="">-</option>
507 <option value="one">One</option>
508 <option value="two">Two</option>
509 <option value="three">Three</option>
510 </select>
511 <span class="input-group-addon rightaddon">
512 <a class="glyph" href="" aria-label="remove" id="id_8">
513 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
514 </a>
515 </span>
516 </div>
517 </div>
518 <div class="col-md-6 col-lg-4 il-popover-container">
519 <div class="input-group">
520 <label class="input-group-addon leftaddon">Multi Selection</label>
521 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
522 <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
523 <span class="input-group-addon rightaddon">
524 <a class="glyph" href="" aria-label="remove" id="id_12">
525 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
526 </a>
527 </span>
528 </div>
529 </div>
530 <div class="col-md-6 col-lg-4 il-popover-container">
531 <div class="input-group">
532 <button class="btn btn-bulky" id="id_18">
533 <span class="glyph" aria-label="add" role="img">
534 <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
535 </span>
536 <span class="bulky-label"></span>
537 </button>
538 </div>
539 <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
540 </div>
541 <div class="il-filter-controls">
542 <button class="btn btn-bulky" data-action="" id="id_2">
543 <span class="glyph" role="img">
544 <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
545 </span>
546 <span class="bulky-label">apply</span>
547 </button>
548 <button class="btn btn-bulky" data-action="#" id="id_3">
549 <span class="glyph" role="img">
550 <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
551 </span>
552 <span class="bulky-label">reset</span>
553 </button>
554 </div>
555 </div>
556 <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
557 <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
558 <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
559 </form>
560</div>
561EOT;
562
563 $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
564 }

References Vendor\Package\$f, ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\UI\examples\Symbol\Glyph\Apply\apply(), buildFactory(), buildInputFactory(), ILIAS\Repository\button(), ILIAS\UI\examples\Symbol\Glyph\Collapse\collapse(), ILIAS\UI\examples\Symbol\Glyph\Expand\expand(), ILIAS\Repository\filter(), and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ testRenderDeactivatedCollapsed()

StandardFilterTest::testRenderDeactivatedCollapsed ( )

Definition at line 290 of file StandardFilterTest.php.

290 : void
291 {
292 $f = $this->buildFactory();
293 $if = $this->buildInputFactory();
294 $inputs = [
295 $if->text("Title"),
296 $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
297 $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
298 ];
299 $inputs_rendered = [true, false, true];
300
301 $filter = $f->standard(
302 "#",
303 "#",
304 "#",
305 "#",
306 "#",
307 "#",
308 $inputs,
309 $inputs_rendered,
310 false,
311 false
312 );
313
314 $r = $this->getDefaultRenderer();
315 $html = $r->render($filter);
316
317 $expected = <<<EOT
318<div class="il-filter disabled" id="id_1">
319 <form class="c-form il-standard-form form-horizontal" enctype="multipart/form-data" method="get" data-cmd-expand="#" data-cmd-collapse="#" data-cmd-apply="#" data-cmd-toggleOn="#" data-cmd-toggleOff="#">
320 <div class="il-filter-bar">
321 <div class="il-filter-bar-opener">
322 <button type="button" aria-expanded="false" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
323 <span>
324 <span data-collapse-glyph-visibility="0">
325 <a class="glyph" aria-label="collapse_content">
326 <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
327 </a>
328 </span>
329 <span data-expand-glyph-visibility="1">
330 <a class="glyph" aria-label="expand_content">
331 <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
332 </a>
333 </span> filter
334 </span>
335 </button>
336 </div>
337 <div class="il-filter-bar-toggle">
338 <div class="il-toggle-item">
339 <button class="il-toggle-button off" id="id_4" aria-pressed="false">
340 <span class="il-toggle-label-on">toggle_on</span>
341 <span class="il-toggle-label-off">toggle_off</span>
342 <span class="il-toggle-switch"></span>
343 </button>
344 </div>
345 </div>
346 </div>
347 <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="1">
348 <span id="1"></span>
349 <span id="2"></span>
350 <span id="3"></span>
351 </div>
352 <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="0">
353 <div class="col-md-6 col-lg-4 il-popover-container">
354 <div class="input-group">
355 <label for="id_5" class="input-group-addon leftaddon">Title</label>
356 <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
357 <span class="input-group-addon rightaddon">
358 <a class="glyph" href="" aria-label="remove" id="id_6">
359 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
360 </a>
361 </span>
362 </div>
363 </div>
364 <div class="col-md-6 col-lg-4 il-popover-container">
365 <div class="input-group">
366 <label for="id_7" class="input-group-addon leftaddon">Selection</label>
367 <select id="id_7" name="filter_input_0/filter_input_2">
368 <option selected="selected" value="">-</option>
369 <option value="one">One</option>
370 <option value="two">Two</option>
371 <option value="three">Three</option>
372 </select>
373 <span class="input-group-addon rightaddon">
374 <a class="glyph" href="" aria-label="remove" id="id_8">
375 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
376 </a>
377 </span>
378 </div>
379 </div>
380 <div class="col-md-6 col-lg-4 il-popover-container">
381 <div class="input-group">
382 <label class="input-group-addon leftaddon">Multi Selection</label>
383 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
384 <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
385 <span class="input-group-addon rightaddon">
386 <a class="glyph" href="" aria-label="remove" id="id_12">
387 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
388 </a>
389 </span>
390 </div>
391 </div>
392 <div class="col-md-6 col-lg-4 il-popover-container">
393 <div class="input-group">
394 <button class="btn btn-bulky" id="id_18">
395 <span class="glyph" aria-label="add" role="img">
396 <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
397 </span>
398 <span class="bulky-label"></span>
399 </button>
400 </div>
401 <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
402 </div>
403 <div class="il-filter-controls">
404 <button class="btn btn-bulky" data-action="" id="id_2">
405 <span class="glyph" role="img">
406 <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
407 </span>
408 <span class="bulky-label">apply</span>
409 </button>
410 <button class="btn btn-bulky" data-action="#" id="id_3">
411 <span class="glyph" role="img">
412 <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
413 </span>
414 <span class="bulky-label">reset</span>
415 </button>
416 </div>
417 </div>
418 <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
419 <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
420 <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
421 </form>
422</div>
423EOT;
424
425 $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
426 }

References Vendor\Package\$f, ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\UI\examples\Symbol\Glyph\Apply\apply(), buildFactory(), buildInputFactory(), ILIAS\Repository\button(), ILIAS\UI\examples\Symbol\Glyph\Collapse\collapse(), ILIAS\UI\examples\Symbol\Glyph\Expand\expand(), ILIAS\Repository\filter(), and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ testRenderDeactivatedExpanded()

StandardFilterTest::testRenderDeactivatedExpanded ( )

Definition at line 566 of file StandardFilterTest.php.

566 : void
567 {
568 $f = $this->buildFactory();
569 $if = $this->buildInputFactory();
570 $inputs = [
571 $if->text("Title"),
572 $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
573 $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
574 ];
575 $inputs_rendered = [true, false, true];
576
577 $filter = $f->standard(
578 "#",
579 "#",
580 "#",
581 "#",
582 "#",
583 "#",
584 $inputs,
585 $inputs_rendered,
586 false,
587 true
588 );
589
590 $r = $this->getDefaultRenderer();
591 $html = $r->render($filter);
592
593 $expected = <<<EOT
594<div class="il-filter disabled" id="id_1">
595 <form class="c-form il-standard-form form-horizontal" enctype="multipart/form-data" method="get" data-cmd-expand="#" data-cmd-collapse="#" data-cmd-apply="#" data-cmd-toggleOn="#" data-cmd-toggleOff="#">
596 <div class="il-filter-bar">
597 <div class="il-filter-bar-opener">
598 <button type="button" aria-expanded="true" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
599 <span>
600 <span data-collapse-glyph-visibility="1">
601 <a class="glyph" aria-label="collapse_content">
602 <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
603 </a>
604 </span>
605 <span data-expand-glyph-visibility="0">
606 <a class="glyph" aria-label="expand_content">
607 <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
608 </a>
609 </span> filter
610 </span>
611 </button>
612 </div>
613 <div class="il-filter-bar-toggle">
614 <div class="il-toggle-item">
615 <button class="il-toggle-button off" id="id_4" aria-pressed="false">
616 <span class="il-toggle-label-on">toggle_on</span>
617 <span class="il-toggle-label-off">toggle_off</span>
618 <span class="il-toggle-switch"></span>
619 </button>
620 </div>
621 </div>
622 </div>
623 <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="0">
624 <span id="1"></span>
625 <span id="2"></span>
626 <span id="3"></span>
627 </div>
628 <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="1">
629 <div class="col-md-6 col-lg-4 il-popover-container">
630 <div class="input-group">
631 <label for="id_5" class="input-group-addon leftaddon">Title</label>
632 <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
633 <span class="input-group-addon rightaddon">
634 <a class="glyph" href="" aria-label="remove" id="id_6">
635 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
636 </a>
637 </span>
638 </div>
639 </div>
640 <div class="col-md-6 col-lg-4 il-popover-container">
641 <div class="input-group">
642 <label for="id_7" class="input-group-addon leftaddon">Selection</label>
643 <select id="id_7" name="filter_input_0/filter_input_2">
644 <option selected="selected" value="">-</option>
645 <option value="one">One</option>
646 <option value="two">Two</option>
647 <option value="three">Three</option>
648 </select>
649 <span class="input-group-addon rightaddon">
650 <a class="glyph" href="" aria-label="remove" id="id_8">
651 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
652 </a>
653 </span>
654 </div>
655 </div>
656 <div class="col-md-6 col-lg-4 il-popover-container">
657 <div class="input-group">
658 <label class="input-group-addon leftaddon">Multi Selection</label>
659 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
660 <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
661 <span class="input-group-addon rightaddon">
662 <a class="glyph" href="" aria-label="remove" id="id_12">
663 <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
664 </a>
665 </span>
666 </div>
667 </div>
668 <div class="col-md-6 col-lg-4 il-popover-container">
669 <div class="input-group">
670 <button class="btn btn-bulky" id="id_18">
671 <span class="glyph" aria-label="add" role="img">
672 <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
673 </span>
674 <span class="bulky-label"></span>
675 </button>
676 </div>
677 <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
678 </div>
679 <div class="il-filter-controls">
680 <button class="btn btn-bulky" data-action="" id="id_2">
681 <span class="glyph" role="img">
682 <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
683 </span>
684 <span class="bulky-label">apply</span>
685 </button>
686 <button class="btn btn-bulky" data-action="#" id="id_3">
687 <span class="glyph" role="img">
688 <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
689 </span>
690 <span class="bulky-label">reset</span>
691 </button>
692 </div>
693 </div>
694 <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
695 <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
696 <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
697 </form>
698</div>
699EOT;
700
701 $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
702 }

References Vendor\Package\$f, ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\UI\examples\Symbol\Glyph\Apply\apply(), buildFactory(), buildInputFactory(), ILIAS\Repository\button(), ILIAS\UI\examples\Symbol\Glyph\Collapse\collapse(), ILIAS\UI\examples\Symbol\Glyph\Expand\expand(), ILIAS\Repository\filter(), and ILIAS\Repository\form().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: