ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
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 680 of file StandardFilterTest.php.

680 : void
681 {
682 $f = $this->buildFactory();
683 $if = $this->buildInputFactory();
684 $inputs = [
685 $if->text("Title")->withDedicatedName('title'),
686 $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"])->withDedicatedName('selection'),
687 $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
688 ];
689 $filter = $f->standard(
690 "#",
691 "#",
692 "#",
693 "#",
694 "#",
695 "#",
696 $inputs,
697 [true, true, true],
698 true,
699 true
700 );
701
702 $inputs = $filter->getInputs();
703 $this->assertEquals('filter_input_0/title', $inputs[0]->getName());
704 $this->assertEquals('filter_input_0/selection', $inputs[1]->getName());
705 $this->assertEquals('filter_input_0/filter_input_1', $inputs[2]->getName());
706 }

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 <span class="glyph" aria-hidden="true">
188 <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
189 </span>
190 </span>
191 <span data-expand-glyph-visibility="1">
192 <span class="glyph" aria-hidden="true">
193 <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
194 </span>
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" role="region" 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" role="region" aria-labelledby="opener_id_1" data-section-inputs-expanded="0">
215 <div class="col-md-6 col-lg-4 il-popover-container">
216 <div data-il-ui-component="text-field-input" data-il-ui-input-name="filter_input_0/filter_input_1" id="id_6" 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 <button type="button" class="btn btn-link" aria-label="remove" data-action="" id="id_7"><span class="glyph" aria-hidden="true"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></span></button>
221 </span>
222 </div>
223 </div>
224 <div class="col-md-6 col-lg-4 il-popover-container">
225 <div data-il-ui-component="select-field-input" data-il-ui-input-name="filter_input_0/filter_input_2" id="id_9" class="input-group">
226 <label for="id_8" class="input-group-addon leftaddon">Selection</label>
227 <select id="id_8" name="filter_input_0/filter_input_2">
228 <option selected="selected" value="">-</option>
229 <option value="one">One</option>
230 <option value="two">Two</option>
231 <option value="three">Three</option>
232 </select>
233 <span class="input-group-addon rightaddon">
234 <button type="button" class="btn btn-link" aria-label="remove" data-action="" id="id_10"><span class="glyph" aria-hidden="true"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></span></button>
235 </span>
236 </div>
237 </div>
238 <div class="col-md-6 col-lg-4 il-popover-container">
239 <div data-il-ui-component="multi-select-field-input" data-il-ui-input-name="filter_input_0/filter_input_3" id="id_11" class="input-group">
240 <label class="input-group-addon leftaddon">Multi Selection</label>
241 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_14" data-placement="bottom"></span>
242 <div class="il-standard-popover-content" style="display:none;" id="id_12"></div>
243 <span class="input-group-addon rightaddon">
244 <button type="button" class="btn btn-link" aria-label="remove" data-action="" id="id_15"><span class="glyph" aria-hidden="true"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></span></button>
245 </span>
246 </div>
247 </div>
248 <div class="col-md-6 col-lg-4 il-popover-container">
249 <div data-il-ui-component="" data-il-ui-input-name="" class="input-group">
250 <button type="button" class="btn btn-bulky" id="id_21" aria-label="add">
251 <span class="glyph" aria-hidden="true">
252 <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
253 </span>
254 <span class="bulky-label"></span>
255 </button>
256 </div>
257 <div class="il-standard-popover-content" style="display:none;" id="id_19"></div>
258 </div>
259 <div class="il-filter-controls">
260 <button class="btn btn-bulky" data-action="" id="id_2">
261 <span class="glyph" aria-hidden="true">
262 <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
263 </span>
264 <span class="bulky-label">apply</span>
265 </button>
266 <button class="btn btn-bulky" data-action="#" id="id_3">
267 <span class="glyph" aria-hidden="true">
268 <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
269 </span>
270 <span class="bulky-label">reset</span>
271 </button>
272 </div>
273 </div>
274 <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
275 <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
276 <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
277 </form>
278</div>
279EOT;
280
281 $this->assertEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
282 }
Title class.
Definition: Title.php:42
button(string $caption, string $cmd)
form(?array $class_path, string $cmd, string $submit_caption="")
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)

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(), ILIAS\Repository\form(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ testRenderActivatedExpanded()

StandardFilterTest::testRenderActivatedExpanded ( )

Definition at line 416 of file StandardFilterTest.php.

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

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(), ILIAS\Repository\form(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ testRenderDeactivatedCollapsed()

StandardFilterTest::testRenderDeactivatedCollapsed ( )

Definition at line 284 of file StandardFilterTest.php.

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

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(), ILIAS\Repository\form(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ testRenderDeactivatedExpanded()

StandardFilterTest::testRenderDeactivatedExpanded ( )

Definition at line 548 of file StandardFilterTest.php.

548 : void
549 {
550 $f = $this->buildFactory();
551 $if = $this->buildInputFactory();
552 $inputs = [
553 $if->text("Title"),
554 $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
555 $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
556 ];
557 $inputs_rendered = [true, false, true];
558
559 $filter = $f->standard(
560 "#",
561 "#",
562 "#",
563 "#",
564 "#",
565 "#",
566 $inputs,
567 $inputs_rendered,
568 false,
569 true
570 );
571
572 $r = $this->getDefaultRenderer();
573 $html = $r->render($filter);
574
575 $expected = <<<EOT
576<div class="il-filter disabled" id="id_1">
577 <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="#">
578 <div class="il-filter-bar">
579 <div class="il-filter-bar-opener">
580 <button type="button" aria-expanded="true" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
581 <span>
582 <span data-collapse-glyph-visibility="1">
583 <span class="glyph" aria-hidden="true">
584 <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
585 </span>
586 </span>
587 <span data-expand-glyph-visibility="0">
588 <span class="glyph" aria-hidden="true">
589 <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
590 </span>
591 </span> filter
592 </span>
593 </button>
594 </div>
595 <div class="il-filter-bar-toggle">
596 <div class="il-toggle-item">
597 <button class="il-toggle-button off" id="id_4" aria-pressed="false">
598 <span class="il-toggle-label-on">toggle_on</span>
599 <span class="il-toggle-label-off">toggle_off</span>
600 <span class="il-toggle-switch"></span>
601 </button>
602 </div>
603 </div>
604 </div>
605 <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" role="region" aria-labelledby="opener_id_1" data-active-inputs-expanded="0">
606 <span id="1"></span>
607 <span id="2"></span>
608 <span id="3"></span>
609 </div>
610 <div class="il-filter-input-section row" id="section_inputs_id_1" role="region" aria-labelledby="opener_id_1" data-section-inputs-expanded="1">
611 <div class="col-md-6 col-lg-4 il-popover-container">
612 <div data-il-ui-component="text-field-input" data-il-ui-input-name="filter_input_0/filter_input_1" id="id_6" class="input-group">
613 <label for="id_5" class="input-group-addon leftaddon">Title</label>
614 <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
615 <span class="input-group-addon rightaddon">
616 <button type="button" class="btn btn-link" aria-label="remove" data-action="" id="id_7"><span class="glyph" aria-hidden="true"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></span></button>
617 </span>
618 </div>
619 </div>
620 <div class="col-md-6 col-lg-4 il-popover-container">
621 <div data-il-ui-component="select-field-input" data-il-ui-input-name="filter_input_0/filter_input_2" id="id_9" class="input-group">
622 <label for="id_8" class="input-group-addon leftaddon">Selection</label>
623 <select id="id_8" name="filter_input_0/filter_input_2">
624 <option selected="selected" value="">-</option>
625 <option value="one">One</option>
626 <option value="two">Two</option>
627 <option value="three">Three</option>
628 </select>
629 <span class="input-group-addon rightaddon">
630 <button type="button" class="btn btn-link" aria-label="remove" data-action="" id="id_10"><span class="glyph" aria-hidden="true"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></span></button>
631 </span>
632 </div>
633 </div>
634 <div class="col-md-6 col-lg-4 il-popover-container">
635 <div data-il-ui-component="multi-select-field-input" data-il-ui-input-name="filter_input_0/filter_input_3" id="id_11" class="input-group">
636 <label class="input-group-addon leftaddon">Multi Selection</label>
637 <span role="button" tabindex="0" class="form-control il-filter-field" id="id_14" data-placement="bottom"></span>
638 <div class="il-standard-popover-content" style="display:none;" id="id_12"></div>
639 <span class="input-group-addon rightaddon">
640 <button type="button" class="btn btn-link" aria-label="remove" data-action="" id="id_15"><span class="glyph" aria-hidden="true"><span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span></span></button>
641 </span>
642 </div>
643 </div>
644 <div class="col-md-6 col-lg-4 il-popover-container">
645 <div data-il-ui-component="" data-il-ui-input-name="" class="input-group">
646 <button type="button" class="btn btn-bulky" id="id_21" aria-label="add">
647 <span class="glyph" aria-hidden="true">
648 <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
649 </span>
650 <span class="bulky-label"></span>
651 </button>
652 </div>
653 <div class="il-standard-popover-content" style="display:none;" id="id_19"></div>
654 </div>
655 <div class="il-filter-controls">
656 <button class="btn btn-bulky" data-action="" id="id_2">
657 <span class="glyph" aria-hidden="true">
658 <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
659 </span>
660 <span class="bulky-label">apply</span>
661 </button>
662 <button class="btn btn-bulky" data-action="#" id="id_3">
663 <span class="glyph" aria-hidden="true">
664 <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
665 </span>
666 <span class="bulky-label">reset</span>
667 </button>
668 </div>
669 </div>
670 <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
671 <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
672 <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
673 </form>
674</div>
675EOT;
676
677 $this->assertEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
678 }

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(), ILIAS\Repository\form(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

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