ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
StandardFilterTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 require_once(__DIR__ . "/../../../../../../../../vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ . "/../../../../Base.php");
23 require_once(__DIR__ . "/FilterTest.php");
24 
25 use ILIAS\Data;
27 
29 {
30  protected I\Button\Factory $button_factory;
31  protected I\Symbol\Factory $symbol_factory;
32  protected I\Popover\Factory $popover_factory;
33  protected I\Legacy\Factory $legacy_factory;
34  protected I\Listing\Factory $listing_factory;
35 
36  public function __construct(
37  I\Button\Factory $button_factory,
38  I\Symbol\Factory $symbol_factory,
39  I\Popover\Factory $popover_factory,
40  I\Legacy\Factory $legacy_factory,
41  I\Listing\Factory $listing_factory
42  ) {
43  $this->button_factory = $button_factory;
44  $this->symbol_factory = $symbol_factory;
45  $this->popover_factory = $popover_factory;
46  $this->legacy_factory = $legacy_factory;
47  $this->listing_factory = $listing_factory;
48  }
49 
50  public function button(): I\Button\Factory
51  {
52  return $this->button_factory;
53  }
54 
55  public function symbol(): I\Symbol\Factory
56  {
57  return $this->symbol_factory;
58  }
59 
60  public function popover(): I\Popover\Factory
61  {
63  }
64 
65  public function legacy(): I\Legacy\Factory
66  {
67  return $this->legacy_factory;
68  }
69 
70  public function listing(): I\Listing\Factory
71  {
73  }
74 }
75 
81 {
82  protected function buildFactory(): I\Input\Container\Filter\Factory
83  {
84  return new I\Input\Container\Filter\Factory(
85  new I\SignalGenerator(),
86  $this->buildInputFactory()
87  );
88  }
89 
90  protected function buildInputFactory(): 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\UploadLimitResolver::class),
96  new I\SignalGenerator(),
97  $df,
98  new ILIAS\Refinery\Factory($df, $language),
99  $language
100  );
101  }
102 
103  protected function buildButtonFactory(): I\Button\Factory
104  {
105  return new I\Button\Factory();
106  }
107 
108  protected function buildSymbolFactory(): I\Symbol\Factory
109  {
110  return new I\Symbol\Factory(
111  new I\Symbol\Icon\Factory(),
112  new I\Symbol\Glyph\Factory(),
113  new I\Symbol\Avatar\Factory()
114  );
115  }
116 
117  protected function buildPopoverFactory(): I\Popover\Factory
118  {
119  return new I\Popover\Factory(new I\SignalGenerator());
120  }
121 
122  protected function buildLegacyFactory(): I\Legacy\Factory
123  {
124  $mock = $this->createMock(I\Legacy\Factory::class);
125  $mock->method('content')->willReturn(
126  new I\Legacy\Content('', new I\SignalGenerator())
127  );
128  return $mock;
129  }
130 
131  protected function buildListingFactory(): I\Listing\Factory
132  {
133  return new I\Listing\Factory(
134  new I\Listing\Workflow\Factory(),
135  new I\Listing\CharacteristicValue\Factory(),
136  new I\Listing\Entity\Factory(),
137  );
138  }
139 
140  public function getUIFactory(): WithNoUIFactories
141  {
142  return new WithNoUIFactories(
143  $this->buildButtonFactory(),
144  $this->buildSymbolFactory(),
145  $this->buildPopoverFactory(),
146  $this->buildLegacyFactory(),
147  $this->buildListingFactory()
148  );
149  }
150 
151  public function testRenderActivatedCollapsed(): void
152  {
153  $f = $this->buildFactory();
154  $if = $this->buildInputFactory();
155  $inputs = [
156  $if->text("Title"),
157  $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
158  $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
159  ];
160  $inputs_rendered = [true, false, true];
161 
162  $filter = $f->standard(
163  "#",
164  "#",
165  "#",
166  "#",
167  "#",
168  "#",
169  $inputs,
170  $inputs_rendered,
171  true,
172  false
173  );
174 
175  $r = $this->getDefaultRenderer();
176  $html = $r->render($filter);
177 
178  $expected = <<<EOT
179 <div class="il-filter enabled" id="id_1">
180  <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="#">
181  <div class="il-filter-bar">
182  <div class="il-filter-bar-opener">
183  <button type="button" aria-expanded="false" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
184  <span>
185  <span data-collapse-glyph-visibility="0">
186  <a class="glyph" aria-label="collapse_content">
187  <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
188  </a>
189  </span>
190  <span data-expand-glyph-visibility="1">
191  <a class="glyph" aria-label="expand_content">
192  <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
193  </a>
194  </span> filter
195  </span>
196  </button>
197  </div>
198  <div class="il-filter-bar-toggle">
199  <div class="il-toggle-item">
200  <button class="il-toggle-button on" id="id_4" aria-pressed="false">
201  <span class="il-toggle-label-on">toggle_on</span>
202  <span class="il-toggle-label-off">toggle_off</span>
203  <span class="il-toggle-switch"></span>
204  </button>
205  </div>
206  </div>
207  </div>
208  <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="1">
209  <span id="1"></span>
210  <span id="2"></span>
211  <span id="3"></span>
212  </div>
213  <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="0">
214  <div class="col-md-6 col-lg-4 il-popover-container">
215  <div class="input-group">
216  <label for="id_5" class="input-group-addon leftaddon">Title</label>
217  <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
218  <span class="input-group-addon rightaddon">
219  <a class="glyph" href="" aria-label="remove" id="id_6">
220  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
221  </a>
222  </span>
223  </div>
224  </div>
225  <div class="col-md-6 col-lg-4 il-popover-container">
226  <div class="input-group">
227  <label for="id_7" class="input-group-addon leftaddon">Selection</label>
228  <select id="id_7" name="filter_input_0/filter_input_2">
229  <option selected="selected" value="">-</option>
230  <option value="one">One</option>
231  <option value="two">Two</option>
232  <option value="three">Three</option>
233  </select>
234  <span class="input-group-addon rightaddon">
235  <a class="glyph" href="" aria-label="remove" id="id_8">
236  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
237  </a>
238  </span>
239  </div>
240  </div>
241  <div class="col-md-6 col-lg-4 il-popover-container">
242  <div class="input-group">
243  <label class="input-group-addon leftaddon">Multi Selection</label>
244  <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
245  <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
246  <span class="input-group-addon rightaddon">
247  <a class="glyph" href="" aria-label="remove" id="id_12">
248  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
249  </a>
250  </span>
251  </div>
252  </div>
253  <div class="col-md-6 col-lg-4 il-popover-container">
254  <div class="input-group">
255  <button class="btn btn-bulky" id="id_18">
256  <span class="glyph" aria-label="add" role="img">
257  <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
258  </span>
259  <span class="bulky-label"></span>
260  </button>
261  </div>
262  <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
263  </div>
264  <div class="il-filter-controls">
265  <button class="btn btn-bulky" data-action="" id="id_2">
266  <span class="glyph" role="img">
267  <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
268  </span>
269  <span class="bulky-label">apply</span>
270  </button>
271  <button class="btn btn-bulky" data-action="#" id="id_3">
272  <span class="glyph" role="img">
273  <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
274  </span>
275  <span class="bulky-label">reset</span>
276  </button>
277  </div>
278  </div>
279  <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
280  <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
281  <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
282  </form>
283 </div>
284 EOT;
285 
286  $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
287  }
288 
289  public function testRenderDeactivatedCollapsed(): void
290  {
291  $f = $this->buildFactory();
292  $if = $this->buildInputFactory();
293  $inputs = [
294  $if->text("Title"),
295  $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
296  $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
297  ];
298  $inputs_rendered = [true, false, true];
299 
300  $filter = $f->standard(
301  "#",
302  "#",
303  "#",
304  "#",
305  "#",
306  "#",
307  $inputs,
308  $inputs_rendered,
309  false,
310  false
311  );
312 
313  $r = $this->getDefaultRenderer();
314  $html = $r->render($filter);
315 
316  $expected = <<<EOT
317 <div class="il-filter disabled" id="id_1">
318  <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="#">
319  <div class="il-filter-bar">
320  <div class="il-filter-bar-opener">
321  <button type="button" aria-expanded="false" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
322  <span>
323  <span data-collapse-glyph-visibility="0">
324  <a class="glyph" aria-label="collapse_content">
325  <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
326  </a>
327  </span>
328  <span data-expand-glyph-visibility="1">
329  <a class="glyph" aria-label="expand_content">
330  <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
331  </a>
332  </span> filter
333  </span>
334  </button>
335  </div>
336  <div class="il-filter-bar-toggle">
337  <div class="il-toggle-item">
338  <button class="il-toggle-button off" id="id_4" aria-pressed="false">
339  <span class="il-toggle-label-on">toggle_on</span>
340  <span class="il-toggle-label-off">toggle_off</span>
341  <span class="il-toggle-switch"></span>
342  </button>
343  </div>
344  </div>
345  </div>
346  <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="1">
347  <span id="1"></span>
348  <span id="2"></span>
349  <span id="3"></span>
350  </div>
351  <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="0">
352  <div class="col-md-6 col-lg-4 il-popover-container">
353  <div class="input-group">
354  <label for="id_5" class="input-group-addon leftaddon">Title</label>
355  <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
356  <span class="input-group-addon rightaddon">
357  <a class="glyph" href="" aria-label="remove" id="id_6">
358  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
359  </a>
360  </span>
361  </div>
362  </div>
363  <div class="col-md-6 col-lg-4 il-popover-container">
364  <div class="input-group">
365  <label for="id_7" class="input-group-addon leftaddon">Selection</label>
366  <select id="id_7" name="filter_input_0/filter_input_2">
367  <option selected="selected" value="">-</option>
368  <option value="one">One</option>
369  <option value="two">Two</option>
370  <option value="three">Three</option>
371  </select>
372  <span class="input-group-addon rightaddon">
373  <a class="glyph" href="" aria-label="remove" id="id_8">
374  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
375  </a>
376  </span>
377  </div>
378  </div>
379  <div class="col-md-6 col-lg-4 il-popover-container">
380  <div class="input-group">
381  <label class="input-group-addon leftaddon">Multi Selection</label>
382  <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
383  <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
384  <span class="input-group-addon rightaddon">
385  <a class="glyph" href="" aria-label="remove" id="id_12">
386  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
387  </a>
388  </span>
389  </div>
390  </div>
391  <div class="col-md-6 col-lg-4 il-popover-container">
392  <div class="input-group">
393  <button class="btn btn-bulky" id="id_18">
394  <span class="glyph" aria-label="add" role="img">
395  <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
396  </span>
397  <span class="bulky-label"></span>
398  </button>
399  </div>
400  <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
401  </div>
402  <div class="il-filter-controls">
403  <button class="btn btn-bulky" data-action="" id="id_2">
404  <span class="glyph" role="img">
405  <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
406  </span>
407  <span class="bulky-label">apply</span>
408  </button>
409  <button class="btn btn-bulky" data-action="#" id="id_3">
410  <span class="glyph" role="img">
411  <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
412  </span>
413  <span class="bulky-label">reset</span>
414  </button>
415  </div>
416  </div>
417  <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
418  <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
419  <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
420  </form>
421 </div>
422 EOT;
423 
424  $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
425  }
426 
427  public function testRenderActivatedExpanded(): void
428  {
429  $f = $this->buildFactory();
430  $if = $this->buildInputFactory();
431  $inputs = [
432  $if->text("Title"),
433  $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
434  $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
435  ];
436  $inputs_rendered = [true, false, true];
437 
438  $filter = $f->standard(
439  "#",
440  "#",
441  "#",
442  "#",
443  "#",
444  "#",
445  $inputs,
446  $inputs_rendered,
447  true,
448  true
449  );
450 
451  $r = $this->getDefaultRenderer();
452  $html = $r->render($filter);
453 
454  $expected = <<<EOT
455 <div class="il-filter enabled" id="id_1">
456  <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="#">
457  <div class="il-filter-bar">
458  <div class="il-filter-bar-opener">
459  <button type="button" aria-expanded="true" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
460  <span>
461  <span data-collapse-glyph-visibility="1">
462  <a class="glyph" aria-label="collapse_content">
463  <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
464  </a>
465  </span>
466  <span data-expand-glyph-visibility="0">
467  <a class="glyph" aria-label="expand_content">
468  <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
469  </a>
470  </span> filter
471  </span>
472  </button>
473  </div>
474  <div class="il-filter-bar-toggle">
475  <div class="il-toggle-item">
476  <button class="il-toggle-button on" id="id_4" aria-pressed="false">
477  <span class="il-toggle-label-on">toggle_on</span>
478  <span class="il-toggle-label-off">toggle_off</span>
479  <span class="il-toggle-switch"></span>
480  </button>
481  </div>
482  </div>
483  </div>
484  <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="0">
485  <span id="1"></span>
486  <span id="2"></span>
487  <span id="3"></span>
488  </div>
489  <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="1">
490  <div class="col-md-6 col-lg-4 il-popover-container">
491  <div class="input-group">
492  <label for="id_5" class="input-group-addon leftaddon">Title</label>
493  <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
494  <span class="input-group-addon rightaddon">
495  <a class="glyph" href="" aria-label="remove" id="id_6">
496  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
497  </a>
498  </span>
499  </div>
500  </div>
501  <div class="col-md-6 col-lg-4 il-popover-container">
502  <div class="input-group">
503  <label for="id_7" class="input-group-addon leftaddon">Selection</label>
504  <select id="id_7" name="filter_input_0/filter_input_2">
505  <option selected="selected" value="">-</option>
506  <option value="one">One</option>
507  <option value="two">Two</option>
508  <option value="three">Three</option>
509  </select>
510  <span class="input-group-addon rightaddon">
511  <a class="glyph" href="" aria-label="remove" id="id_8">
512  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
513  </a>
514  </span>
515  </div>
516  </div>
517  <div class="col-md-6 col-lg-4 il-popover-container">
518  <div class="input-group">
519  <label class="input-group-addon leftaddon">Multi Selection</label>
520  <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
521  <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
522  <span class="input-group-addon rightaddon">
523  <a class="glyph" href="" aria-label="remove" id="id_12">
524  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
525  </a>
526  </span>
527  </div>
528  </div>
529  <div class="col-md-6 col-lg-4 il-popover-container">
530  <div class="input-group">
531  <button class="btn btn-bulky" id="id_18">
532  <span class="glyph" aria-label="add" role="img">
533  <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
534  </span>
535  <span class="bulky-label"></span>
536  </button>
537  </div>
538  <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
539  </div>
540  <div class="il-filter-controls">
541  <button class="btn btn-bulky" data-action="" id="id_2">
542  <span class="glyph" role="img">
543  <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
544  </span>
545  <span class="bulky-label">apply</span>
546  </button>
547  <button class="btn btn-bulky" data-action="#" id="id_3">
548  <span class="glyph" role="img">
549  <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
550  </span>
551  <span class="bulky-label">reset</span>
552  </button>
553  </div>
554  </div>
555  <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
556  <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
557  <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
558  </form>
559 </div>
560 EOT;
561 
562  $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
563  }
564 
565  public function testRenderDeactivatedExpanded(): void
566  {
567  $f = $this->buildFactory();
568  $if = $this->buildInputFactory();
569  $inputs = [
570  $if->text("Title"),
571  $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"]),
572  $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
573  ];
574  $inputs_rendered = [true, false, true];
575 
576  $filter = $f->standard(
577  "#",
578  "#",
579  "#",
580  "#",
581  "#",
582  "#",
583  $inputs,
584  $inputs_rendered,
585  false,
586  true
587  );
588 
589  $r = $this->getDefaultRenderer();
590  $html = $r->render($filter);
591 
592  $expected = <<<EOT
593 <div class="il-filter disabled" id="id_1">
594  <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="#">
595  <div class="il-filter-bar">
596  <div class="il-filter-bar-opener">
597  <button type="button" aria-expanded="true" aria-controls="active_inputs_id_1 section_inputs_id_1" id="opener_id_1">
598  <span>
599  <span data-collapse-glyph-visibility="1">
600  <a class="glyph" aria-label="collapse_content">
601  <span class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
602  </a>
603  </span>
604  <span data-expand-glyph-visibility="0">
605  <a class="glyph" aria-label="expand_content">
606  <span class="glyphicon glyphicon-triangle-right" aria-hidden="true"></span>
607  </a>
608  </span> filter
609  </span>
610  </button>
611  </div>
612  <div class="il-filter-bar-toggle">
613  <div class="il-toggle-item">
614  <button class="il-toggle-button off" id="id_4" aria-pressed="false">
615  <span class="il-toggle-label-on">toggle_on</span>
616  <span class="il-toggle-label-off">toggle_off</span>
617  <span class="il-toggle-switch"></span>
618  </button>
619  </div>
620  </div>
621  </div>
622  <div class="il-filter-inputs-active clearfix" id="active_inputs_id_1" aria-labelledby="opener_id_1" data-active-inputs-expanded="0">
623  <span id="1"></span>
624  <span id="2"></span>
625  <span id="3"></span>
626  </div>
627  <div class="il-filter-input-section row" id="section_inputs_id_1" aria-labelledby="opener_id_1" data-section-inputs-expanded="1">
628  <div class="col-md-6 col-lg-4 il-popover-container">
629  <div class="input-group">
630  <label for="id_5" class="input-group-addon leftaddon">Title</label>
631  <input id="id_5" type="text" name="filter_input_0/filter_input_1" class="c-field-text" />
632  <span class="input-group-addon rightaddon">
633  <a class="glyph" href="" aria-label="remove" id="id_6">
634  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
635  </a>
636  </span>
637  </div>
638  </div>
639  <div class="col-md-6 col-lg-4 il-popover-container">
640  <div class="input-group">
641  <label for="id_7" class="input-group-addon leftaddon">Selection</label>
642  <select id="id_7" name="filter_input_0/filter_input_2">
643  <option selected="selected" value="">-</option>
644  <option value="one">One</option>
645  <option value="two">Two</option>
646  <option value="three">Three</option>
647  </select>
648  <span class="input-group-addon rightaddon">
649  <a class="glyph" href="" aria-label="remove" id="id_8">
650  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
651  </a>
652  </span>
653  </div>
654  </div>
655  <div class="col-md-6 col-lg-4 il-popover-container">
656  <div class="input-group">
657  <label class="input-group-addon leftaddon">Multi Selection</label>
658  <span role="button" tabindex="0" class="form-control il-filter-field" id="id_11" data-placement="bottom"></span>
659  <div class="il-standard-popover-content" style="display:none;" id="id_9"></div>
660  <span class="input-group-addon rightaddon">
661  <a class="glyph" href="" aria-label="remove" id="id_12">
662  <span class="glyphicon glyphicon-minus-sign" aria-hidden="true"></span>
663  </a>
664  </span>
665  </div>
666  </div>
667  <div class="col-md-6 col-lg-4 il-popover-container">
668  <div class="input-group">
669  <button class="btn btn-bulky" id="id_18">
670  <span class="glyph" aria-label="add" role="img">
671  <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
672  </span>
673  <span class="bulky-label"></span>
674  </button>
675  </div>
676  <div class="il-standard-popover-content" style="display:none;" id="id_16"></div>
677  </div>
678  <div class="il-filter-controls">
679  <button class="btn btn-bulky" data-action="" id="id_2">
680  <span class="glyph" role="img">
681  <span class="glyphicon glyphicon-apply" aria-hidden="true"></span>
682  </span>
683  <span class="bulky-label">apply</span>
684  </button>
685  <button class="btn btn-bulky" data-action="#" id="id_3">
686  <span class="glyph" role="img">
687  <span class="glyphicon glyphicon-reset" aria-hidden="true"></span>
688  </span>
689  <span class="bulky-label">reset</span>
690  </button>
691  </div>
692  </div>
693  <input class="il-filter-field-status" type="hidden" name="__filter_status_0" value="1" />
694  <input class="il-filter-field-status" type="hidden" name="__filter_status_1" value="0" />
695  <input class="il-filter-field-status" type="hidden" name="__filter_status_2" value="1" />
696  </form>
697 </div>
698 EOT;
699 
700  $this->assertHTMLEquals($this->brutallyTrimHTML($expected), $this->brutallyTrimHTML($html));
701  }
702 
703  public function testDedicatedNames(): void
704  {
705  $f = $this->buildFactory();
706  $if = $this->buildInputFactory();
707  $inputs = [
708  $if->text("Title")->withDedicatedName('title'),
709  $if->select("Selection", ["one" => "One", "two" => "Two", "three" => "Three"])->withDedicatedName('selection'),
710  $if->multiSelect("Multi Selection", ["one" => "Num One", "two" => "Num Two", "three" => "Num Three"])
711  ];
712  $filter = $f->standard(
713  "#",
714  "#",
715  "#",
716  "#",
717  "#",
718  "#",
719  $inputs,
720  [true, true, true],
721  true,
722  true
723  );
724 
725  $inputs = $filter->getInputs();
726  $this->assertEquals('filter_input_0/title', $inputs[0]->getName());
727  $this->assertEquals('filter_input_0/selection', $inputs[1]->getName());
728  $this->assertEquals('filter_input_0/filter_input_1', $inputs[2]->getName());
729  }
730 }
apply()
description: > Example for rendring a apply glyph.
Definition: apply.php:41
__construct(I\Button\Factory $button_factory, I\Symbol\Factory $symbol_factory, I\Popover\Factory $popover_factory, I\Legacy\Factory $legacy_factory, I\Listing\Factory $listing_factory)
popover()
description: purpose: > Popovers can be used when space is scarce i.e.
listing()
description: purpose: > Listings are used to structure itemised textual information.
Interface Observer Contains several chained tasks and infos about them.
I Listing Factory $listing_factory
Title class.
Definition: Title.php:41
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
I Symbol Factory $symbol_factory
collapse()
description: > Example for rendering a collapse glyph.
Definition: collapse.php:43
symbol()
description: purpose: > Symbols are graphical representations of concepts or contexts quickly compre...
Test on standard filter implementation.
Builds data types.
Definition: Factory.php:35
input()
description: purpose: > In opposite to components with a purely receptive or at most navigational ch...
Definition: Base.php:116
I Popover Factory $popover_factory
form( $class_path, string $cmd, string $submit_caption="")
expand()
description: > Example for rendering an expand glyph.
Definition: expand.php:41
I Button Factory $button_factory
legacy()
description: purpose: > legacy components are used as provisional elements in the UI framework while...
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
button()
description: purpose: > Buttons trigger interactions that change the system’s or view&#39;s status...
I Legacy Factory $legacy_factory
$r