‪TYPO3CMS  10.4
SelectViewHelperTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use PHPUnit\Framework\Exception;
22 use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
23 use TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder;
24 
28 class ‪SelectViewHelperTest extends ViewHelperBaseTestcase
29 {
33  protected ‪$viewHelper;
34 
35  protected function ‪setUp(): void
36  {
37  parent::setUp();
38  $this->arguments['name'] = '';
39  $this->arguments['sortByOptionLabel'] = false;
40  $this->viewHelper = $this->getAccessibleMock(SelectViewHelper::class, ['setErrorClassAttribute', 'registerFieldNameForFormTokenGeneration', 'renderChildren']);
41  $this->tagBuilder = $this->createMock(TagBuilder::class);
42  $this->viewHelper->setTagBuilder($this->tagBuilder);
43  }
44 
48  public function ‪selectCorrectlySetsTagName()
49  {
50  $this->tagBuilder->expects(self::atLeastOnce())->method('setTagName')->with('select');
51 
52  $this->arguments['options'] = [];
53  $this->injectDependenciesIntoViewHelper($this->viewHelper);
54  $this->viewHelper->setTagBuilder($this->tagBuilder);
55  $this->viewHelper->initializeArgumentsAndRender();
56  }
57 
61  public function ‪selectCreatesExpectedOptions()
62  {
63  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
64  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
65  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="value1">label1</option>' . \chr(10) . '<option value="value2" selected="selected">label2</option>' . \chr(10));
66  $this->tagBuilder->expects(self::once())->method('render');
67 
68  $this->arguments['options'] = [
69  'value1' => 'label1',
70  'value2' => 'label2'
71  ];
72  $this->arguments['value'] = 'value2';
73  $this->arguments['name'] = 'myName';
74 
75  $this->injectDependenciesIntoViewHelper($this->viewHelper);
76  $this->viewHelper->setTagBuilder($this->tagBuilder);
77  $this->viewHelper->initializeArgumentsAndRender();
78  }
79 
84  {
85  $this->tagBuilder->expects(self::exactly(2))->method('addAttribute')->withConsecutive(
86  ['required', 'required'],
87  ['name', 'myName']
88  );
89  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
90  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="value1">label1</option>' . \chr(10) . '<option value="value2" selected="selected">label2</option>' . \chr(10));
91  $this->tagBuilder->expects(self::once())->method('render');
92 
93  $this->arguments['options'] = [
94  'value1' => 'label1',
95  'value2' => 'label2'
96  ];
97  $this->arguments['value'] = 'value2';
98  $this->arguments['name'] = 'myName';
99  $this->arguments['required'] = true;
100 
101  $this->injectDependenciesIntoViewHelper($this->viewHelper);
102  $this->viewHelper->setTagBuilder($this->tagBuilder);
103  $this->viewHelper->initializeArgumentsAndRender();
104  }
105 
110  {
111  $this->tagBuilder->expects(self::once())->method('setContent')->with(
112  '<option value="2"></option>' . \chr(10) .
113  '<option value="-1">Bar</option>' . \chr(10) .
114  '<option value="">Baz</option>' . \chr(10) .
115  '<option value="1">Foo</option>' . \chr(10)
116  );
117 
118  $this->arguments['optionValueField'] = 'uid';
119  $this->arguments['optionLabelField'] = 'title';
120  $this->arguments['sortByOptionLabel'] = true;
121  $this->arguments['options'] = [
122  [
123  'uid' => 1,
124  'title' => 'Foo'
125  ],
126  [
127  'uid' => -1,
128  'title' => 'Bar'
129  ],
130  [
131  'title' => 'Baz'
132  ],
133  [
134  'uid' => '2'
135  ],
136  ];
137 
138  $this->injectDependenciesIntoViewHelper($this->viewHelper);
139  $this->viewHelper->setTagBuilder($this->tagBuilder);
140  $this->viewHelper->initializeArgumentsAndRender();
141  }
142 
147  {
148  $this->tagBuilder->expects(self::once())->method('setContent')->with(
149  '<option value="2"></option>' . \chr(10) .
150  '<option value="-1">Bar</option>' . \chr(10) .
151  '<option value="">Baz</option>' . \chr(10) .
152  '<option value="1">Foo</option>' . \chr(10)
153  );
154 
155  $obj1 = new \stdClass();
156  $obj1->uid = 1;
157  $obj1->title = 'Foo';
158 
159  $obj2 = new \stdClass();
160  $obj2->uid = -1;
161  $obj2->title = 'Bar';
162 
163  $obj3 = new \stdClass();
164  $obj3->title = 'Baz';
165 
166  $obj4 = new \stdClass();
167  $obj4->uid = 2;
168 
169  $this->arguments['optionValueField'] = 'uid';
170  $this->arguments['optionLabelField'] = 'title';
171  $this->arguments['sortByOptionLabel'] = true;
172  $this->arguments['options'] = [$obj1, $obj2, $obj3, $obj4];
173 
174  $this->injectDependenciesIntoViewHelper($this->viewHelper);
175  $this->viewHelper->setTagBuilder($this->tagBuilder);
176  $this->viewHelper->initializeArgumentsAndRender();
177  }
178 
183  {
184  $this->tagBuilder->expects(self::once())->method('setContent')->with(
185  '<option value="2"></option>' . \chr(10) .
186  '<option value="-1">Bar</option>' . \chr(10) .
187  '<option value="">Baz</option>' . \chr(10) .
188  '<option value="1">Foo</option>' . \chr(10)
189  );
190 
191  $this->arguments['optionValueField'] = 'uid';
192  $this->arguments['optionLabelField'] = 'title';
193  $this->arguments['sortByOptionLabel'] = true;
194  $this->arguments['options'] = new \ArrayObject([
195  [
196  'uid' => 1,
197  'title' => 'Foo'
198  ],
199  [
200  'uid' => -1,
201  'title' => 'Bar'
202  ],
203  [
204  'title' => 'Baz'
205  ],
206  [
207  'uid' => '2'
208  ],
209  ]);
210 
211  $this->injectDependenciesIntoViewHelper($this->viewHelper);
212  $this->viewHelper->setTagBuilder($this->tagBuilder);
213  $this->viewHelper->initializeArgumentsAndRender();
214  }
215 
220  {
221  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
222  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
223  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="value3">label3</option>' . \chr(10) . '<option value="value1">label1</option>' . \chr(10) . '<option value="value2" selected="selected">label2</option>' . \chr(10));
224  $this->tagBuilder->expects(self::once())->method('render');
225 
226  $this->arguments['options'] = [
227  'value3' => 'label3',
228  'value1' => 'label1',
229  'value2' => 'label2'
230  ];
231 
232  $this->arguments['value'] = 'value2';
233  $this->arguments['name'] = 'myName';
234 
235  $this->injectDependenciesIntoViewHelper($this->viewHelper);
236  $this->viewHelper->setTagBuilder($this->tagBuilder);
237  $this->viewHelper->initializeArgumentsAndRender();
238  }
239 
244  {
245  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
246  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
247  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="value1">label1</option>' . \chr(10) . '<option value="value2" selected="selected">label2</option>' . \chr(10) . '<option value="value3">label3</option>' . \chr(10));
248  $this->tagBuilder->expects(self::once())->method('render');
249 
250  $this->arguments['options'] = [
251  'value3' => 'label3',
252  'value1' => 'label1',
253  'value2' => 'label2'
254  ];
255 
256  $this->arguments['value'] = 'value2';
257  $this->arguments['name'] = 'myName';
258  $this->arguments['sortByOptionLabel'] = true;
259 
260  $this->injectDependenciesIntoViewHelper($this->viewHelper);
261  $this->viewHelper->setTagBuilder($this->tagBuilder);
262  $this->viewHelper->initializeArgumentsAndRender();
263  }
264 
270  {
271  $locale = 'de_DE.UTF-8';
272  try {
273  $this->setLocale(LC_COLLATE, $locale);
274  $this->setLocale(LC_CTYPE, $locale);
275  $this->setLocale(LC_MONETARY, $locale);
276  $this->setLocale(LC_TIME, $locale);
277  } catch (Exception $e) {
278  self::markTestSkipped('Locale ' . $locale . ' is not available.');
279  }
280 
281  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
282  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
283  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="value1">Bamberg</option>' . \chr(10) . '<option value="value2" selected="selected">Bämm</option>' . \chr(10) . '<option value="value3">Bar</option>' . \chr(10) . '<option value="value4">Bär</option>' . \chr(10) . '<option value="value5">Burg</option>' . \chr(10));
284  $this->tagBuilder->expects(self::once())->method('render');
285  $this->arguments['options'] = [
286  'value4' => 'Bär',
287  'value2' => 'Bämm',
288  'value5' => 'Burg',
289  'value1' => 'Bamberg',
290  'value3' => 'Bar'
291  ];
292  $this->arguments['value'] = 'value2';
293  $this->arguments['name'] = 'myName';
294  $this->arguments['sortByOptionLabel'] = true;
295  $this->injectDependenciesIntoViewHelper($this->viewHelper);
296  $this->viewHelper->setTagBuilder($this->tagBuilder);
297  $this->viewHelper->initializeArgumentsAndRender();
298  }
299 
304  {
305  $this->tagBuilder = new TagBuilder();
306  $this->viewHelper->expects(self::exactly(3))->method('registerFieldNameForFormTokenGeneration')->with('myName[]');
307 
308  $this->arguments['options'] = [
309  'value1' => 'label1',
310  'value2' => 'label2',
311  'value3' => 'label3'
312  ];
313 
314  $this->arguments['value'] = ['value3', 'value1'];
315  $this->arguments['name'] = 'myName';
316  $this->arguments['multiple'] = true;
317 
318  $this->injectDependenciesIntoViewHelper($this->viewHelper);
319  $this->viewHelper->setTagBuilder($this->tagBuilder);
320  $result = $this->viewHelper->initializeArgumentsAndRender();
321  $expected = '<input type="hidden" name="myName" value="" /><select multiple="multiple" name="myName[]"><option value="value1" selected="selected">label1</option>' . \chr(10) . '<option value="value2">label2</option>' . \chr(10) . '<option value="value3" selected="selected">label3</option>' . \chr(10) . '</select>';
322  self::assertSame($expected, $result);
323  }
324 
329  {
330  $this->tagBuilder = new TagBuilder();
331  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName[]');
332 
333  $this->arguments['options'] = [];
334  $this->arguments['value'] = ['value3', 'value1'];
335  $this->arguments['name'] = 'myName';
336  $this->arguments['multiple'] = true;
337 
338  $this->injectDependenciesIntoViewHelper($this->viewHelper);
339  $this->viewHelper->setTagBuilder($this->tagBuilder);
340  $result = $this->viewHelper->initializeArgumentsAndRender();
341  $expected = '<input type="hidden" name="myName" value="" /><select multiple="multiple" name="myName[]"></select>';
342  self::assertSame($expected, $result);
343  }
344 
349  {
350  $mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);
351  $mockPersistenceManager->expects(self::any())->method('getIdentifierByObject')->willReturn(2);
352  $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
353 
354  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName[__identity]');
355  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName[__identity]');
356  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="1">Ingmar</option>' . \chr(10) . '<option value="2" selected="selected">Sebastian</option>' . \chr(10) . '<option value="3">Robert</option>' . \chr(10));
357  $this->tagBuilder->expects(self::once())->method('render');
358 
359  $user_is = new UserDomainClass(1, 'Ingmar', 'Schlecht');
360  $user_sk = new UserDomainClass(2, 'Sebastian', 'Kurfuerst');
361  $user_rl = new UserDomainClass(3, 'Robert', 'Lemke');
362 
363  $this->arguments['options'] = [
364  $user_is,
365  $user_sk,
366  $user_rl
367  ];
368 
369  $this->arguments['value'] = $user_sk;
370  $this->arguments['optionValueField'] = 'id';
371  $this->arguments['optionLabelField'] = 'firstName';
372  $this->arguments['name'] = 'myName';
373  $this->injectDependenciesIntoViewHelper($this->viewHelper);
374  $this->viewHelper->setTagBuilder($this->tagBuilder);
375  $this->viewHelper->initializeArgumentsAndRender();
376  }
377 
382  {
383  $this->tagBuilder = new TagBuilder();
384  $this->viewHelper->expects(self::exactly(3))->method('registerFieldNameForFormTokenGeneration')->with('myName[]');
385 
386  $user_is = new UserDomainClass(1, 'Ingmar', 'Schlecht');
387  $user_sk = new UserDomainClass(2, 'Sebastian', 'Kurfuerst');
388  $user_rl = new UserDomainClass(3, 'Robert', 'Lemke');
389  $this->arguments['options'] = [
390  $user_is,
391  $user_sk,
392  $user_rl
393  ];
394  $this->arguments['value'] = [$user_rl, $user_is];
395  $this->arguments['optionValueField'] = 'id';
396  $this->arguments['optionLabelField'] = 'lastName';
397  $this->arguments['name'] = 'myName';
398  $this->arguments['multiple'] = true;
399 
400  $this->injectDependenciesIntoViewHelper($this->viewHelper);
401  $this->viewHelper->setTagBuilder($this->tagBuilder);
402  $actual = $this->viewHelper->initializeArgumentsAndRender();
403  $expected = '<input type="hidden" name="myName" value="" /><select multiple="multiple" name="myName[]"><option value="1" selected="selected">Schlecht</option>' . \chr(10) .
404  '<option value="2">Kurfuerst</option>' . \chr(10) .
405  '<option value="3" selected="selected">Lemke</option>' . \chr(10) .
406  '</select>';
407 
408  self::assertSame($expected, $actual);
409  }
410 
415  {
417  $mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);
418  $mockPersistenceManager->expects(self::any())->method('getIdentifierByObject')->willReturnCallback(
419  function ($object) {
420  return $object->getId();
421  }
422  );
423  $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
424 
425  $this->tagBuilder = new TagBuilder();
426  $this->viewHelper->expects(self::exactly(3))->method('registerFieldNameForFormTokenGeneration')->with('myName[]');
427 
428  $user_is = new UserDomainClass(1, 'Ingmar', 'Schlecht');
429  $user_sk = new UserDomainClass(2, 'Sebastian', 'Kurfuerst');
430  $user_rl = new UserDomainClass(3, 'Robert', 'Lemke');
431 
432  $this->arguments['options'] = [$user_is, $user_sk, $user_rl];
433  $this->arguments['value'] = [$user_rl, $user_is];
434  $this->arguments['optionLabelField'] = 'lastName';
435  $this->arguments['name'] = 'myName';
436  $this->arguments['multiple'] = true;
437 
438  $this->injectDependenciesIntoViewHelper($this->viewHelper);
439  $this->viewHelper->setTagBuilder($this->tagBuilder);
440  $actual = $this->viewHelper->initializeArgumentsAndRender();
441  $expected = '<input type="hidden" name="myName" value="" />' .
442  '<select multiple="multiple" name="myName[]">' .
443  '<option value="1" selected="selected">Schlecht</option>' . \chr(10) .
444  '<option value="2">Kurfuerst</option>' . \chr(10) .
445  '<option value="3" selected="selected">Lemke</option>' . \chr(10) .
446  '</select>';
447  self::assertSame($expected, $actual);
448  }
449 
454  {
455  $mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);
456  $mockPersistenceManager->expects(self::any())->method('getIdentifierByObject')->willReturn('fakeUID');
457  $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
458 
459  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
460  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
461  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="fakeUID">fakeUID</option>' . \chr(10));
462  $this->tagBuilder->expects(self::once())->method('render');
463 
464  $user = new UserDomainClass(1, 'Ingmar', 'Schlecht');
465 
466  $this->arguments['options'] = [
467  $user
468  ];
469  $this->arguments['name'] = 'myName';
470  $this->injectDependenciesIntoViewHelper($this->viewHelper);
471  $this->viewHelper->setTagBuilder($this->tagBuilder);
472  $this->viewHelper->initializeArgumentsAndRender();
473  }
474 
479  {
480  $mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);
481  $mockPersistenceManager->expects(self::any())->method('getIdentifierByObject')->willReturn('fakeUID');
482  $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
483 
484  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
485  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
486  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="fakeUID">toStringResult</option>' . \chr(10));
487  $this->tagBuilder->expects(self::once())->method('render');
488 
489  $user = $this->getMockBuilder(UserDomainClass::class)
490  ->setMethods(['__toString'])
491  ->setConstructorArgs([1, 'Ingmar', 'Schlecht'])
492  ->getMock();
493  $user->expects(self::atLeastOnce())->method('__toString')->willReturn('toStringResult');
494 
495  $this->arguments['options'] = [
496  $user
497  ];
498  $this->arguments['name'] = 'myName';
499  $this->injectDependenciesIntoViewHelper($this->viewHelper);
500  $this->viewHelper->setTagBuilder($this->tagBuilder);
501  $this->viewHelper->initializeArgumentsAndRender();
502  }
503 
508  {
509  $mockPersistenceManager = $this->createMock(PersistenceManagerInterface::class);
510  $mockPersistenceManager->expects(self::any())->method('getIdentifierByObject')->willReturn(null);
511  $this->viewHelper->_set('persistenceManager', $mockPersistenceManager);
512 
513  $this->expectException(\‪TYPO3Fluid\Fluid\Core\ViewHelper\Exception::class);
514  $this->expectExceptionCode(1247826696);
515 
516  $user = new UserDomainClass(1, 'Ingmar', 'Schlecht');
517 
518  $this->arguments['options'] = [
519  $user
520  ];
521  $this->arguments['name'] = 'myName';
522  $this->injectDependenciesIntoViewHelper($this->viewHelper);
523  $this->viewHelper->setTagBuilder($this->tagBuilder);
524  $this->viewHelper->initializeArgumentsAndRender();
525  }
526 
530  public function ‪renderCallsSetErrorClassAttribute()
531  {
532  $this->arguments['options'] = [];
533 
534  $this->injectDependenciesIntoViewHelper($this->viewHelper);
535  $this->viewHelper->setTagBuilder($this->tagBuilder);
536  $this->viewHelper->expects(self::once())->method('setErrorClassAttribute');
537  $this->viewHelper->initializeArgumentsAndRender();
538  }
539 
544  {
545  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="value1" selected="selected">label1</option>' . \chr(10) . '<option value="value2" selected="selected">label2</option>' . \chr(10) . '<option value="value3" selected="selected">label3</option>' . \chr(10));
546 
547  $this->arguments['options'] = [
548  'value1' => 'label1',
549  'value2' => 'label2',
550  'value3' => 'label3'
551  ];
552  $this->arguments['name'] = 'myName';
553  $this->arguments['multiple'] = true;
554  $this->arguments['selectAllByDefault'] = true;
555 
556  $this->injectDependenciesIntoViewHelper($this->viewHelper);
557  $this->viewHelper->setTagBuilder($this->tagBuilder);
558  $this->viewHelper->initializeArgumentsAndRender();
559  }
560 
564  public function ‪selectAllHasNoEffectIfValueIsSet()
565  {
566  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="value1" selected="selected">label1</option>' . \chr(10) . '<option value="value2" selected="selected">label2</option>' . \chr(10) . '<option value="value3">label3</option>' . \chr(10));
567 
568  $this->arguments['options'] = [
569  'value1' => 'label1',
570  'value2' => 'label2',
571  'value3' => 'label3'
572  ];
573  $this->arguments['value'] = ['value2', 'value1'];
574  $this->arguments['name'] = 'myName';
575  $this->arguments['multiple'] = true;
576  $this->arguments['selectAllByDefault'] = true;
577 
578  $this->injectDependenciesIntoViewHelper($this->viewHelper);
579  $this->viewHelper->setTagBuilder($this->tagBuilder);
580  $this->viewHelper->initializeArgumentsAndRender();
581  }
582 
587  {
588  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
589  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
590  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="">please choose</option>' . \chr(10) . '<option value="value1">label1</option>' . \chr(10) . '<option value="value2">label2</option>' . \chr(10) . '<option value="value3">label3</option>' . \chr(10));
591  $this->tagBuilder->expects(self::once())->method('render');
592  $this->arguments['options'] = [
593  'value1' => 'label1',
594  'value2' => 'label2',
595  'value3' => 'label3'
596  ];
597  $this->arguments['name'] = 'myName';
598  $this->arguments['prependOptionLabel'] = 'please choose';
599  $this->injectDependenciesIntoViewHelper($this->viewHelper);
600  $this->viewHelper->setTagBuilder($this->tagBuilder);
601  $this->viewHelper->initializeArgumentsAndRender();
602  }
603 
608  {
609  $this->tagBuilder->expects(self::once())->method('addAttribute')->with('name', 'myName');
610  $this->viewHelper->expects(self::once())->method('registerFieldNameForFormTokenGeneration')->with('myName');
611  $this->tagBuilder->expects(self::once())->method('setContent')->with('<option value="-1">please choose</option>' . \chr(10) . '<option value="value1">label1</option>' . \chr(10) . '<option value="value2">label2</option>' . \chr(10) . '<option value="value3">label3</option>' . \chr(10));
612  $this->tagBuilder->expects(self::once())->method('render');
613  $this->arguments['options'] = [
614  'value1' => 'label1',
615  'value2' => 'label2',
616  'value3' => 'label3'
617  ];
618  $this->arguments['name'] = 'myName';
619  $this->arguments['prependOptionLabel'] = 'please choose';
620  $this->arguments['prependOptionValue'] = '-1';
621  $this->injectDependenciesIntoViewHelper($this->viewHelper);
622  $this->viewHelper->setTagBuilder($this->tagBuilder);
623  $this->viewHelper->initializeArgumentsAndRender();
624  }
625 }
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\optionsContainPrependedItemWithEmptyValueIfPrependOptionLabelIsSet
‪optionsContainPrependedItemWithEmptyValueIfPrependOptionLabelIsSet()
Definition: SelectViewHelperTest.php:585
‪TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
Definition: PersistenceManagerInterface.php:22
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectCorrectlySetsTagName
‪selectCorrectlySetsTagName()
Definition: SelectViewHelperTest.php:47
‪TYPO3Fluid
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest
Definition: SelectViewHelperTest.php:29
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectShouldSetTheRequiredAttribute
‪selectShouldSetTheRequiredAttribute()
Definition: SelectViewHelperTest.php:82
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\OrderOfOptionsIsNotAlteredByDefault
‪OrderOfOptionsIsNotAlteredByDefault()
Definition: SelectViewHelperTest.php:218
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\allOptionsAreSelectedIfSelectAllIsTrue
‪allOptionsAreSelectedIfSelectAllIsTrue()
Definition: SelectViewHelperTest.php:542
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectCreatesExpectedOptionsWithStdClassesAndOptionValueFieldAndOptionLabelFieldSet
‪selectCreatesExpectedOptionsWithStdClassesAndOptionValueFieldAndOptionLabelFieldSet()
Definition: SelectViewHelperTest.php:145
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectWithoutFurtherConfigurationOnDomainObjectsUsesUuidForValueAndLabel
‪selectWithoutFurtherConfigurationOnDomainObjectsUsesUuidForValueAndLabel()
Definition: SelectViewHelperTest.php:452
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\multipleSelectCreatesExpectedOptions
‪multipleSelectCreatesExpectedOptions()
Definition: SelectViewHelperTest.php:302
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\multipleSelectWithoutOptionsCreatesExpectedOptions
‪multipleSelectWithoutOptionsCreatesExpectedOptions()
Definition: SelectViewHelperTest.php:327
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\multipleSelectOnDomainObjectsCreatesExpectedOptionsWithoutOptionValueField
‪multipleSelectOnDomainObjectsCreatesExpectedOptionsWithoutOptionValueField()
Definition: SelectViewHelperTest.php:413
‪TYPO3\CMS\Fluid\ViewHelpers\Form\SelectViewHelper
Definition: SelectViewHelper.php:95
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\optionsAreSortedByLabelIfSortByOptionLabelIsSet
‪optionsAreSortedByLabelIfSortByOptionLabelIsSet()
Definition: SelectViewHelperTest.php:242
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectOnDomainObjectsThrowsExceptionIfNoValueCanBeFound
‪selectOnDomainObjectsThrowsExceptionIfNoValueCanBeFound()
Definition: SelectViewHelperTest.php:506
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectCreatesExpectedOptionsWithArraysAndOptionValueFieldAndOptionLabelFieldSet
‪selectCreatesExpectedOptionsWithArraysAndOptionValueFieldAndOptionLabelFieldSet()
Definition: SelectViewHelperTest.php:108
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form
Definition: AbstractFormFieldViewHelperTest.php:16
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\setUp
‪setUp()
Definition: SelectViewHelperTest.php:34
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\$viewHelper
‪SelectViewHelper $viewHelper
Definition: SelectViewHelperTest.php:32
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\multipleSelectOnDomainObjectsCreatesExpectedOptions
‪multipleSelectOnDomainObjectsCreatesExpectedOptions()
Definition: SelectViewHelperTest.php:380
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectOnDomainObjectsCreatesExpectedOptions
‪selectOnDomainObjectsCreatesExpectedOptions()
Definition: SelectViewHelperTest.php:347
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectAllHasNoEffectIfValueIsSet
‪selectAllHasNoEffectIfValueIsSet()
Definition: SelectViewHelperTest.php:563
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\optionsContainPrependedItemWithCorrectValueIfPrependOptionLabelAndPrependOptionValueAreSet
‪optionsContainPrependedItemWithCorrectValueIfPrependOptionLabelAndPrependOptionValueAreSet()
Definition: SelectViewHelperTest.php:606
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\Fixtures\UserDomainClass
Definition: UserDomainClass.php:22
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\optionsAreSortedByLabelIfSortByOptionLabelIsSetAndLocaleEqualsUtf8
‪optionsAreSortedByLabelIfSortByOptionLabelIsSetAndLocaleEqualsUtf8()
Definition: SelectViewHelperTest.php:268
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\renderCallsSetErrorClassAttribute
‪renderCallsSetErrorClassAttribute()
Definition: SelectViewHelperTest.php:529
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectWithoutFurtherConfigurationOnDomainObjectsUsesToStringForLabelIfAvailable
‪selectWithoutFurtherConfigurationOnDomainObjectsUsesToStringForLabelIfAvailable()
Definition: SelectViewHelperTest.php:477
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectCreatesExpectedOptions
‪selectCreatesExpectedOptions()
Definition: SelectViewHelperTest.php:60
‪TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\SelectViewHelperTest\selectCreatesExpectedOptionsWithArrayObjectsAndOptionValueFieldAndOptionLabelFieldSet
‪selectCreatesExpectedOptionsWithArrayObjectsAndOptionValueFieldAndOptionLabelFieldSet()
Definition: SelectViewHelperTest.php:181