‪TYPO3CMS  ‪main
ConfigurationServiceTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
28 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
29 
30 final class ‪ConfigurationServiceTest extends UnitTestCase
31 {
32  protected bool ‪$resetSingletonInstances = true;
33 
34  #[Test]
36  {
37  $configurationManagerMock = $this->createMock(ConfigurationManagerInterface::class);
38  $configurationManagerMock->method('getConfiguration')->with(‪ConfigurationManagerInterface::CONFIGURATION_TYPE_YAML_SETTINGS, 'form')
39  ->willReturn([
40  'prototypes' => [
41  'standard' => [
42  'key' => 'value',
43  ],
44  ],
45  ]);
46  $configurationService = new ‪ConfigurationService($configurationManagerMock);
47 
48  $expected = [
49  'key' => 'value',
50  ];
51 
52  self::assertSame($expected, $configurationService->getPrototypeConfiguration('standard'));
53  }
54 
55  #[Test]
57  {
58  $configurationManagerMock = $this->createMock(ConfigurationManagerInterface::class);
59  $configurationManagerMock->method('getConfiguration')->with(‪ConfigurationManagerInterface::CONFIGURATION_TYPE_YAML_SETTINGS, 'form')
60  ->willReturn([
61  'prototypes' => [
62  'noStandard' => [],
63  ],
64  ]);
65  $configurationService = new ‪ConfigurationService($configurationManagerMock);
66 
67  $this->expectException(PrototypeNotFoundException::class);
68  $this->expectExceptionCode(1475924277);
69 
70  $configurationService->getPrototypeConfiguration('standard');
71  }
72 
73  #[Test]
75  {
76  $configurationManagerMock = $this->createMock(ConfigurationManagerInterface::class);
77  $configurationManagerMock->method('getConfiguration')->with(‪ConfigurationManagerInterface::CONFIGURATION_TYPE_YAML_SETTINGS, 'form')
78  ->willReturn([
79  'formManager' => [
80  'selectablePrototypesConfiguration' => [
81  0 => [
82  'identifier' => 'standard',
83  ],
84  1 => [
85  'identifier' => 'custom',
86  ],
87  'a' => [
88  'identifier' => 'custom-2',
89  ],
90  ],
91  ],
92  ]);
93  $configurationService = new ‪ConfigurationService($configurationManagerMock);
94 
95  $expected = [
96  'standard',
97  'custom',
98  ];
99 
100  self::assertSame($expected, $configurationService->getSelectablePrototypeNamesDefinedInFormEditorSetup());
101  }
102 
103  #[DataProvider('isFormElementPropertyDefinedInFormEditorSetupDataProvider')]
104  #[Test]
106  array $configuration,
107  ‪ValidationDto $validationDto,
108  bool $expectedReturn
109  ): void {
110  $configurationService = $this->getAccessibleMock(
111  ConfigurationService::class,
112  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
113  [],
114  '',
115  false
116  );
117  $configurationService->method(
118  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
119  )->willReturn($configuration);
120 
121  self::assertSame(
122  $expectedReturn,
123  $configurationService->isFormElementPropertyDefinedInFormEditorSetup($validationDto)
124  );
125  }
126 
127  #[DataProvider('isPropertyCollectionPropertyDefinedInFormEditorSetupDataProvider')]
128  #[Test]
130  array $configuration,
131  ‪ValidationDto $validationDto,
132  bool $expectedReturn
133  ): void {
134  $configurationService = $this->getAccessibleMock(
135  ConfigurationService::class,
136  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
137  [],
138  '',
139  false
140  );
141  $configurationService->method(
142  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
143  )->willReturn($configuration);
144 
145  self::assertSame(
146  $expectedReturn,
147  $configurationService->isPropertyCollectionPropertyDefinedInFormEditorSetup($validationDto)
148  );
149  }
150 
151  #[DataProvider('isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetupDataProvider')]
152  #[Test]
154  array $configuration,
155  ‪ValidationDto $validationDto,
156  bool $expectedReturn
157  ): void {
158  $configurationService = $this->getAccessibleMock(
159  ConfigurationService::class,
160  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
161  [],
162  '',
163  false
164  );
165  $configurationService->method(
166  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
167  )->willReturn($configuration);
168 
169  self::assertSame(
170  $expectedReturn,
171  $configurationService->isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup($validationDto)
172  );
173  }
174 
175  #[DataProvider('isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetupDataProvider')]
176  #[Test]
178  array $configuration,
179  ‪ValidationDto $validationDto,
180  bool $expectedReturn
181  ): void {
182  $configurationService = $this->getAccessibleMock(
183  ConfigurationService::class,
184  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
185  [],
186  '',
187  false
188  );
189  $configurationService->method(
190  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
191  )->willReturn($configuration);
192 
193  self::assertSame(
194  $expectedReturn,
195  $configurationService->isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup(
196  $validationDto
197  )
198  );
199  }
200 
201  #[Test]
203  ): void {
204  $this->expectException(PropertyException::class);
205  $this->expectExceptionCode(1528578401);
206 
207  $configurationService = $this->getAccessibleMock(
208  ConfigurationService::class,
209  ['isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup'],
210  [],
211  '',
212  false
213  );
214  $configurationService->method(
215  'isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup'
216  )->willReturn(false);
217  $validationDto = new ‪ValidationDto(null, 'Text', null, 'properties.foo.1');
218 
219  $configurationService->getFormElementPredefinedDefaultValueFromFormEditorSetup($validationDto);
220  }
221 
222  #[Test]
224  {
225  $expected = 'foo';
226  $configuration = ['formElements' => ['Text' => ['predefinedDefaults' => ['properties.foo.1' => $expected]]]];
227 
228  $configurationService = $this->getAccessibleMock(
229  ConfigurationService::class,
230  [
231  'buildFormDefinitionValidationConfigurationFromFormEditorSetup',
232  'isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup',
233  ],
234  [],
235  '',
236  false
237  );
238  $configurationService->method(
239  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
240  )->willReturn($configuration);
241  $configurationService->method(
242  'isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup'
243  )->willReturn(true);
244 
245  $validationDto = new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1');
246 
247  self::assertSame(
248  $expected,
249  $configurationService->getFormElementPredefinedDefaultValueFromFormEditorSetup($validationDto)
250  );
251  }
252 
253  #[Test]
255  ): void {
256  $this->expectException(PropertyException::class);
257  $this->expectExceptionCode(1528578402);
258 
259  $configurationService = $this->getAccessibleMock(
260  ConfigurationService::class,
261  ['isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup'],
262  [],
263  '',
264  false
265  );
266  $configurationService->method(
267  'isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup'
268  )->willReturn(false);
269  $validationDto = new ‪ValidationDto(
270  null,
271  null,
272  null,
273  'properties.foo.1',
274  'validators',
275  'StringLength'
276  );
277 
278  $configurationService->getPropertyCollectionPredefinedDefaultValueFromFormEditorSetup($validationDto);
279  }
280 
281  #[Test]
283  {
284  $expected = 'foo';
285  $configuration = ['collections' => ['validators' => ['StringLength' => ['predefinedDefaults' => ['properties.foo.1' => $expected]]]]];
286 
287  $configurationService = $this->getAccessibleMock(
288  ConfigurationService::class,
289  [
290  'buildFormDefinitionValidationConfigurationFromFormEditorSetup',
291  'isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup',
292  ],
293  [],
294  '',
295  false
296  );
297  $configurationService->method(
298  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
299  )->willReturn($configuration);
300  $configurationService->method(
301  'isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup'
302  )->willReturn(true);
303 
304  $validationDto = new ‪ValidationDto(
305  'standard',
306  null,
307  null,
308  'properties.foo.1',
309  'validators',
310  'StringLength'
311  );
312 
313  self::assertSame(
314  $expected,
315  $configurationService->getPropertyCollectionPredefinedDefaultValueFromFormEditorSetup($validationDto)
316  );
317  }
318 
319  #[DataProvider('isFormElementTypeCreatableByFormEditorDataProvider')]
320  #[Test]
322  array $configuration,
323  ‪ValidationDto $validationDto,
324  bool $expectedReturn
325  ): void {
326  $configurationService = $this->getAccessibleMock(
327  ConfigurationService::class,
328  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
329  [],
330  '',
331  false
332  );
333  $configurationService->method(
334  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
335  )->willReturn($configuration);
336 
337  self::assertSame(
338  $expectedReturn,
339  $configurationService->isFormElementTypeCreatableByFormEditor($validationDto)
340  );
341  }
342 
343  #[DataProvider('isPropertyCollectionElementIdentifierCreatableByFormEditorDataProvider')]
344  #[Test]
346  array $configuration,
347  ‪ValidationDto $validationDto,
348  bool $expectedReturn
349  ): void {
350  $configurationService = $this->getAccessibleMock(
351  ConfigurationService::class,
352  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
353  [],
354  '',
355  false
356  );
357  $configurationService->method(
358  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
359  )->willReturn($configuration);
360 
361  self::assertSame(
362  $expectedReturn,
363  $configurationService->isPropertyCollectionElementIdentifierCreatableByFormEditor($validationDto)
364  );
365  }
366 
367  #[Test]
369  {
370  $configuration = [
371  'formElementsDefinition' => [
372  'Text' => [],
373  ],
374  ];
375 
376  $configurationService = $this->getAccessibleMock(
377  ConfigurationService::class,
378  ['getPrototypeConfiguration'],
379  [],
380  '',
381  false
382  );
383  $configurationService->method('getPrototypeConfiguration')->willReturn($configuration);
384 
385  $validationDto = new ‪ValidationDto('standard', 'Text');
386  self::assertTrue($configurationService->isFormElementTypeDefinedInFormSetup($validationDto));
387 
388  $validationDto = new ‪ValidationDto('standard', 'Foo');
389  self::assertFalse($configurationService->isFormElementTypeDefinedInFormSetup($validationDto));
390  }
391 
392  #[Test]
394  {
395  $this->expectException(PropertyException::class);
396  $this->expectExceptionCode(1528633966);
397 
398  $configurationService = $this->getAccessibleMock(ConfigurationService::class, null, [], '', false);
399  $input = ['dummy'];
400 
401  $configurationService->_call('addAdditionalPropertyPathsFromHook', '', '', $input, []);
402  }
403 
404  #[Test]
406  {
407  $this->expectException(PropertyException::class);
408  $this->expectExceptionCode(1528634966);
409 
410  $configurationService = $this->getAccessibleMock(ConfigurationService::class, null, [], '', false);
411  $validationDto = new ‪ValidationDto('Bar', 'Foo');
412  $input = [$validationDto];
413 
414  $configurationService->_call('addAdditionalPropertyPathsFromHook', '', 'standard', $input, []);
415  }
416 
417  #[Test]
419  {
420  $this->expectException(PropertyException::class);
421  $this->expectExceptionCode(1528633967);
422 
423  $configurationService = $this->getAccessibleMock(
424  ConfigurationService::class,
425  ['isFormElementTypeDefinedInFormSetup'],
426  [],
427  '',
428  false
429  );
430  $configurationService->method('isFormElementTypeDefinedInFormSetup')->willReturn(false);
431  $validationDto = new ‪ValidationDto('standard', 'Text');
432  $input = [$validationDto];
433 
434  $configurationService->_call('addAdditionalPropertyPathsFromHook', '', 'standard', $input, []);
435  }
436 
437  #[Test]
439  {
440  $this->expectException(PropertyException::class);
441  $this->expectExceptionCode(1528636941);
442 
443  $configurationService = $this->getAccessibleMock(
444  ConfigurationService::class,
445  ['isFormElementTypeDefinedInFormSetup'],
446  [],
447  '',
448  false
449  );
450  $configurationService->method('isFormElementTypeDefinedInFormSetup')->willReturn(true);
451  $validationDto = new ‪ValidationDto('standard', 'Text', null, null, 'Bar', 'Baz');
452  $input = [$validationDto];
453 
454  $configurationService->_call('addAdditionalPropertyPathsFromHook', '', 'standard', $input, []);
455  }
456 
457  #[Test]
459  {
460  $configurationService = $this->getAccessibleMock(
461  ConfigurationService::class,
462  ['isFormElementTypeDefinedInFormSetup'],
463  [],
464  '',
465  false
466  );
467  $configurationService->method('isFormElementTypeDefinedInFormSetup')->willReturn(true);
468 
469  $input = [
470  new ‪ValidationDto('standard', 'Text', null, 'options.xxx', 'validators', 'Baz'),
471  new ‪ValidationDto('standard', 'Text', null, 'options.yyy', 'validators', 'Baz'),
472  new ‪ValidationDto('standard', 'Text', null, 'options.zzz', 'validators', 'Custom'),
473  new ‪ValidationDto('standard', 'Text', null, 'properties.xxx'),
474  new ‪ValidationDto('standard', 'Text', null, 'properties.yyy'),
475  new ‪ValidationDto('standard', 'Custom', null, 'properties.xxx'),
476  ];
477  $expected = [
478  'formElements' => [
479  'Text' => [
480  'collections' => [
481  'validators' => [
482  'Baz' => [
483  'additionalPropertyPaths' => [
484  'options.xxx',
485  'options.yyy',
486  ],
487  ],
488  'Custom' => [
489  'additionalPropertyPaths' => [
490  'options.zzz',
491  ],
492  ],
493  ],
494  ],
495  'additionalPropertyPaths' => [
496  'properties.xxx',
497  'properties.yyy',
498  ],
499  ],
500  'Custom' => [
501  'additionalPropertyPaths' => [
502  'properties.xxx',
503  ],
504  ],
505  ],
506  ];
507 
508  self::assertSame(
509  $expected,
510  $configurationService->_call('addAdditionalPropertyPathsFromHook', '', 'standard', $input, [])
511  );
512  }
513 
514  #[DataProvider('buildFormDefinitionValidationConfigurationFromFormEditorSetupDataProvider')]
515  #[Test]
516  public function ‪buildFormDefinitionValidationConfigurationFromFormEditorSetup(array $configuration, array $expected): void
517  {
518  $configurationService = $this->getAccessibleMock(
519  ConfigurationService::class,
520  [
521  'getCacheEntry',
522  'getPrototypeConfiguration',
523  'getTranslationService',
524  'executeBuildFormDefinitionValidationConfigurationHooks',
525  'setCacheEntry',
526  ],
527  [],
528  '',
529  false
530  );
531 
532  $translationService = $this->getAccessibleMock(
533  TranslationService::class,
534  ['translateValuesRecursive'],
535  [],
536  '',
537  false
538  );
539  $translationService->method('translateValuesRecursive')->willReturnArgument(0);
540 
541  $configurationService->method('getCacheEntry')->willReturn(null);
542  $configurationService->method('getPrototypeConfiguration')->willReturn($configuration);
543  $configurationService->method('getTranslationService')->willReturn($translationService);
544  $configurationService
545  ->method('executeBuildFormDefinitionValidationConfigurationHooks')
546  ->willReturnArgument(1);
547  $configurationService->method('setCacheEntry');
548 
549  self::assertSame(
550  $expected,
551  $configurationService->_call('buildFormDefinitionValidationConfigurationFromFormEditorSetup', 'standard')
552  );
553  }
554 
556  {
557  return [
558  [
559  ['formElements' => ['Text' => []]],
560  new ‪ValidationDto('standard', 'Text', null, 'properties.foo'),
561  false,
562  ],
563  [
564  ['formElements' => ['Text' => ['selectOptions' => []]]],
565  new ‪ValidationDto('standard', 'Text', null, 'properties.foo'),
566  false,
567  ],
568  [
569  ['formElements' => ['Text' => ['selectOptions' => ['properties.foo' => []]]]],
570  new ‪ValidationDto('standard', 'Text', null, 'properties.foo'),
571  true,
572  ],
573  [
574  ['formElements' => ['Text' => ['selectOptions' => ['properties.foo' => []], 'multiValueProperties' => []]]],
575  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
576  false,
577  ],
578  [
579  ['formElements' => ['Text' => ['selectOptions' => ['properties.foo' => []], 'multiValueProperties' => ['properties.foo']]]],
580  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
581  true,
582  ],
583  ];
584  }
585 
586  #[DataProvider('formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetupDataProvider')]
587  #[Test]
589  array $configuration,
590  ‪ValidationDto $validationDto,
591  bool $expectedReturn
592  ): void {
593  $configurationServiceMock = $this->getAccessibleMock(
594  ConfigurationService::class,
595  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
596  [],
597  '',
598  false
599  );
600  $configurationServiceMock->method(
601  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
602  )->willReturn($configuration);
603 
604  self::assertSame(
605  $expectedReturn,
606  $configurationServiceMock->formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup($validationDto)
607  );
608  }
609 
610  #[Test]
612  {
613  $this->expectException(PropertyException::class);
614  $this->expectExceptionCode(1614264312);
615 
616  $configurationServiceMock = $this->getAccessibleMock(
617  ConfigurationService::class,
618  ['formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup'],
619  [],
620  '',
621  false
622  );
623  $configurationServiceMock->method(
624  'formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup'
625  )->willReturn(false);
626  $validationDto = new ‪ValidationDto('standard', 'Text', null, 'properties.foo');
627 
628  $configurationServiceMock->getAllowedValuesForFormElementPropertyFromFormEditorSetup($validationDto);
629  }
630 
632  {
633  return [
634  [
635  ['formElements' => ['Text' => ['selectOptions' => ['properties.foo' => []]]]],
636  new ‪ValidationDto('standard', 'Text', null, 'properties.foo'),
637  [],
638  ],
639  [
640  ['formElements' => ['Text' => ['selectOptions' => ['properties.foo' => []], 'multiValueProperties' => ['properties.foo']]]],
641  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
642  [],
643  ],
644  [
645  ['formElements' => ['Text' => ['selectOptions' => ['properties.foo' => ['bar', 'baz']]]]],
646  new ‪ValidationDto('standard', 'Text', null, 'properties.foo'),
647  ['bar', 'baz'],
648  ],
649  [
650  ['formElements' => ['Text' => ['selectOptions' => ['properties.foo' => ['bar', 'baz']], 'multiValueProperties' => ['properties.foo']]]],
651  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
652  ['bar', 'baz'],
653  ],
654  ];
655  }
656 
657  #[DataProvider('getAllowedValuesForFormElementPropertyFromFormEditorSetupDataProvider')]
658  #[Test]
660  array $configuration,
661  ‪ValidationDto $validationDto,
662  array $expectedReturn
663  ): void {
664  $configurationServiceMock = $this->getAccessibleMock(
665  ConfigurationService::class,
666  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
667  [],
668  '',
669  false
670  );
671  $configurationServiceMock->method(
672  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
673  )->willReturn($configuration);
674 
675  self::assertSame(
676  $expectedReturn,
677  $configurationServiceMock->getAllowedValuesForFormElementPropertyFromFormEditorSetup($validationDto)
678  );
679  }
680 
682  {
683  return [
684  [
685  ['collections' => ['validators' => ['StringLength' => []]]],
686  new ‪ValidationDto('standard', null, null, 'properties.foo', 'validators', 'StringLength'),
687  false,
688  ],
689  [
690  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => []]]]],
691  new ‪ValidationDto('standard', null, null, 'properties.foo', 'validators', 'StringLength'),
692  false,
693  ],
694  [
695  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => ['properties.foo' => []]]]]],
696  new ‪ValidationDto('standard', null, null, 'properties.foo', 'validators', 'StringLength'),
697  true,
698  ],
699  [
700  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => ['properties.foo' => []], 'multiValueProperties' => []]]]],
701  new ‪ValidationDto('standard', null, null, 'properties.foo.1', 'validators', 'StringLength'),
702  false,
703  ],
704  [
705  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => ['properties.foo' => []], 'multiValueProperties' => ['properties.foo']]]]],
706  new ‪ValidationDto('standard', null, null, 'properties.foo.1', 'validators', 'StringLength'),
707  true,
708  ],
709  ];
710  }
711 
712  #[DataProvider('propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetupDataProvider')]
713  #[Test]
715  array $configuration,
716  ‪ValidationDto $validationDto,
717  bool $expectedReturn
718  ): void {
719  $configurationServiceMock = $this->getAccessibleMock(
720  ConfigurationService::class,
721  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
722  [],
723  '',
724  false
725  );
726  $configurationServiceMock->method(
727  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
728  )->willReturn($configuration);
729 
730  self::assertSame(
731  $expectedReturn,
732  $configurationServiceMock->propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup($validationDto)
733  );
734  }
735 
736  #[Test]
738  {
739  $this->expectException(PropertyException::class);
740  $this->expectExceptionCode(1614264313);
741 
742  $configurationServiceMock = $this->getAccessibleMock(
743  ConfigurationService::class,
744  ['propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup'],
745  [],
746  '',
747  false
748  );
749  $configurationServiceMock->method(
750  'propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup'
751  )->willReturn(false);
752  $validationDto = new ‪ValidationDto('standard', null, null, 'properties.foo', 'validators', 'StringLength');
753 
754  $configurationServiceMock->getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetup($validationDto);
755  }
756 
758  {
759  return [
760  [
761  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => ['properties.foo' => []]]]]],
762  new ‪ValidationDto('standard', null, null, 'properties.foo', 'validators', 'StringLength'),
763  [],
764  ],
765  [
766  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => ['properties.foo' => []], 'multiValueProperties' => ['properties.foo']]]]],
767  new ‪ValidationDto('standard', null, null, 'properties.foo.1', 'validators', 'StringLength'),
768  [],
769  ],
770  [
771  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => ['properties.foo' => ['bar', 'baz']]]]]],
772  new ‪ValidationDto('standard', null, null, 'properties.foo', 'validators', 'StringLength'),
773  ['bar', 'baz'],
774  ],
775  [
776  ['collections' => ['validators' => ['StringLength' => ['selectOptions' => ['properties.foo' => ['bar', 'baz']], 'multiValueProperties' => ['properties.foo']]]]],
777  new ‪ValidationDto('standard', null, null, 'properties.foo.1', 'validators', 'StringLength'),
778  ['bar', 'baz'],
779  ],
780  ];
781  }
782 
783  #[DataProvider('getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetupDataProvider')]
784  #[Test]
786  array $configuration,
787  ‪ValidationDto $validationDto,
788  array $expectedReturn
789  ): void {
790  $configurationServiceMock = $this->getAccessibleMock(
791  ConfigurationService::class,
792  ['buildFormDefinitionValidationConfigurationFromFormEditorSetup'],
793  [],
794  '',
795  false
796  );
797  $configurationServiceMock->method(
798  'buildFormDefinitionValidationConfigurationFromFormEditorSetup'
799  )->willReturn($configuration);
800 
801  self::assertSame(
802  $expectedReturn,
803  $configurationServiceMock->getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetup($validationDto)
804  );
805  }
806 
808  {
809  return [
810  [
811  ['formElements' => ['Text' => ['propertyPaths' => ['properties.foo.1']]]],
812  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
813  true,
814  ],
815  [
816  ['formElements' => ['Text' => ['additionalElementPropertyPaths' => ['properties.foo.1']]]],
817  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
818  true,
819  ],
820  [
821  ['formElements' => ['Text' => ['multiValueProperties' => ['properties.foo.1']]]],
822  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
823  true,
824  ],
825  [
826  ['formElements' => ['Text' => ['multiValueProperties' => ['properties.foo.1']]]],
827  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1.bar'),
828  true,
829  ],
830  [
831  ['formElements' => ['Text' => ['additionalPropertyPaths' => ['properties.foo.1']]]],
832  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
833  true,
834  ],
835  [
836  ['formElements' => ['Text' => ['propertyPaths' => ['properties.foo.1']]]],
837  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1'),
838  false,
839  ],
840  [
841  ['formElements' => ['Text' => ['propertyPaths' => ['properties.foo.1']]]],
842  new ‪ValidationDto('standard', 'Text', null, 'properties.bar.1'),
843  false,
844  ],
845  [
846  ['formElements' => ['Text' => ['additionalElementPropertyPaths' => ['properties.foo.1']]]],
847  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1'),
848  false,
849  ],
850  [
851  ['formElements' => ['Text' => ['additionalElementPropertyPaths' => ['properties.foo.1']]]],
852  new ‪ValidationDto('standard', 'Text', null, 'properties.bar.1'),
853  false,
854  ],
855  [
856  ['formElements' => ['Text' => ['multiValueProperties' => ['properties.foo.1']]]],
857  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1'),
858  false,
859  ],
860  [
861  ['formElements' => ['Text' => ['multiValueProperties' => ['properties.foo.1']]]],
862  new ‪ValidationDto('standard', 'Text', null, 'properties.bar.1'),
863  false,
864  ],
865  [
866  ['formElements' => ['Text' => ['multiValueProperties' => ['properties.foo.1']]]],
867  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1.bar'),
868  false,
869  ],
870  [
871  ['formElements' => ['Text' => ['multiValueProperties' => ['properties.foo.1']]]],
872  new ‪ValidationDto('standard', 'Text', null, 'properties.bar.1.foo'),
873  false,
874  ],
875  [
876  ['formElements' => ['Text' => ['additionalPropertyPaths' => ['properties.foo.1']]]],
877  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1'),
878  false,
879  ],
880  [
881  ['formElements' => ['Text' => ['additionalPropertyPaths' => ['properties.foo.1']]]],
882  new ‪ValidationDto('standard', 'Text', null, 'properties.bar.1'),
883  false,
884  ],
885  ];
886  }
887 
889  {
890  return [
891  [
892  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['propertyPaths' => ['properties.foo.1']]]]]]],
893  new ‪ValidationDto(
894  'standard',
895  'Text',
896  null,
897  'properties.foo.1',
898  'validators',
899  'StringLength'
900  ),
901  true,
902  ],
903  [
904  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['multiValueProperties' => ['properties.foo.1']]]]]]],
905  new ‪ValidationDto(
906  'standard',
907  'Text',
908  null,
909  'properties.foo.1',
910  'validators',
911  'StringLength'
912  ),
913  true,
914  ],
915  [
916  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['multiValueProperties' => ['properties.foo.1']]]]]]],
917  new ‪ValidationDto(
918  'standard',
919  'Text',
920  null,
921  'properties.foo.1.bar',
922  'validators',
923  'StringLength'
924  ),
925  true,
926  ],
927  [
928  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['additionalPropertyPaths' => ['properties.foo.1']]]]]]],
929  new ‪ValidationDto(
930  'standard',
931  'Text',
932  null,
933  'properties.foo.1',
934  'validators',
935  'StringLength'
936  ),
937  true,
938  ],
939  [
940  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['propertyPaths' => ['properties.foo.1']]]]]]],
941  new ‪ValidationDto(
942  'standard',
943  'Text',
944  null,
945  'properties.foo.2',
946  'validators',
947  'StringLength'
948  ),
949  false,
950  ],
951  [
952  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['propertyPaths' => ['properties.foo.1']]]]]]],
953  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1', 'validators', 'StringLength'),
954  false,
955  ],
956  [
957  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['propertyPaths' => ['properties.foo.1']]]]]]],
958  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1', 'foo', 'StringLength'),
959  false,
960  ],
961  [
962  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['propertyPaths' => ['properties.foo.1']]]]]]],
963  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1', 'validators', 'Foo'),
964  false,
965  ],
966  [
967  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['multiValueProperties' => ['properties.foo.1']]]]]]],
968  new ‪ValidationDto(
969  'standard',
970  'Text',
971  null,
972  'properties.foo.2',
973  'validators',
974  'StringLength'
975  ),
976  false,
977  ],
978  [
979  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['multiValueProperties' => ['properties.foo.1']]]]]]],
980  new ‪ValidationDto(
981  'standard',
982  'Foo',
983  null,
984  'properties.foo.1.bar',
985  'validators',
986  'StringLength'
987  ),
988  false,
989  ],
990  [
991  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['multiValueProperties' => ['properties.foo.1']]]]]]],
992  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1.bar', 'foo', 'StringLength'),
993  false,
994  ],
995  [
996  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['multiValueProperties' => ['properties.foo.1']]]]]]],
997  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1.bar', 'validators', 'Foo'),
998  false,
999  ],
1000  [
1001  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['additionalPropertyPaths' => ['properties.foo.1']]]]]]],
1002  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1', 'validators', 'StringLength'),
1003  false,
1004  ],
1005  [
1006  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['additionalPropertyPaths' => ['properties.foo.1']]]]]]],
1007  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1', 'foo', 'StringLength'),
1008  false,
1009  ],
1010  [
1011  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['additionalPropertyPaths' => ['properties.foo.1']]]]]]],
1012  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1', 'validators', 'Foo'),
1013  false,
1014  ],
1015  ];
1016  }
1017 
1019  {
1020  return [
1021  [
1022  ['formElements' => ['Text' => ['predefinedDefaults' => ['properties.foo.1' => 'bar']]]],
1023  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.1'),
1024  true,
1025  ],
1026  [
1027  ['formElements' => ['Text' => ['predefinedDefaults' => ['properties.foo.1' => 'bar']]]],
1028  new ‪ValidationDto('standard', 'Text', null, 'properties.foo.2'),
1029  false,
1030  ],
1031  [
1032  ['formElements' => ['Text' => ['predefinedDefaults' => ['properties.foo.1' => 'bar']]]],
1033  new ‪ValidationDto('standard', 'Foo', null, 'properties.foo.1'),
1034  false,
1035  ],
1036  ];
1037  }
1038 
1040  {
1041  return [
1042  [
1043  ['collections' => ['validators' => ['StringLength' => ['predefinedDefaults' => ['properties.foo.1' => 'bar']]]]],
1044  new ‪ValidationDto('standard', null, null, 'properties.foo.1', 'validators', 'StringLength'),
1045  true,
1046  ],
1047  [
1048  ['collections' => ['validators' => ['StringLength' => ['predefinedDefaults' => ['properties.foo.1' => 'bar']]]]],
1049  new ‪ValidationDto('standard', null, null, 'properties.foo.2', 'validators', 'StringLength'),
1050  false,
1051  ],
1052  [
1053  ['collections' => ['validators' => ['StringLength' => ['predefinedDefaults' => ['properties.foo.1' => 'bar']]]]],
1054  new ‪ValidationDto('standard', null, null, 'properties.foo.1', 'foo', 'StringLength'),
1055  false,
1056  ],
1057  [
1058  ['collections' => ['validators' => ['StringLength' => ['predefinedDefaults' => ['properties.foo.1' => 'bar']]]]],
1059  new ‪ValidationDto('standard', null, null, 'properties.foo.1', 'validators', 'Foo'),
1060  false,
1061  ],
1062  ];
1063  }
1064 
1066  {
1067  return [
1068  [
1069  [],
1070  new ‪ValidationDto('standard', 'Form'),
1071  true,
1072  ],
1073  [
1074  ['formElements' => ['Text' => ['creatable' => true]]],
1075  new ‪ValidationDto('standard', 'Text'),
1076  true,
1077  ],
1078  [
1079  ['formElements' => ['Text' => ['creatable' => false]]],
1080  new ‪ValidationDto('standard', 'Text'),
1081  false,
1082  ],
1083  [
1084  ['formElements' => ['Foo' => ['creatable' => true]]],
1085  new ‪ValidationDto('standard', 'Text'),
1086  false,
1087  ],
1088  ];
1089  }
1090 
1092  {
1093  return [
1094  [
1095  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['creatable' => true]]]]]],
1096  new ‪ValidationDto('standard', 'Text', null, null, 'validators', 'StringLength'),
1097  true,
1098  ],
1099  [
1100  ['formElements' => ['Text' => ['collections' => ['validators' => ['StringLength' => ['creatable' => false]]]]]],
1101  new ‪ValidationDto('standard', 'Text', null, null, 'validators', 'StringLength'),
1102  false,
1103  ],
1104  [
1105  ['formElements' => ['Foo' => ['collections' => ['validators' => ['StringLength' => ['creatable' => true]]]]]],
1106  new ‪ValidationDto('standard', 'Text', null, null, 'validators', 'StringLength'),
1107  false,
1108  ],
1109  [
1110  ['formElements' => ['Text' => ['collections' => ['foo' => ['StringLength' => ['creatable' => true]]]]]],
1111  new ‪ValidationDto('standard', 'Text', null, null, 'validators', 'StringLength'),
1112  false,
1113  ],
1114  [
1115  ['formElements' => ['Text' => ['collections' => ['validators' => ['Foo' => ['creatable' => true]]]]]],
1116  new ‪ValidationDto('standard', 'Text', null, null, 'validators', 'StringLength'),
1117  false,
1118  ],
1119  ];
1120  }
1121 
1123  {
1124  return [
1125  [
1126  [
1127  'formElementsDefinition' => [
1128  'Text' => [
1129  'formEditor' => [
1130  'editors' => [
1131  [
1132  'templateName' => 'Foo',
1133  'propertyPath' => 'properties.foo',
1134  'setup' => [
1135  'propertyPath' => 'properties.bar',
1136  ],
1137  ],
1138  ],
1139  ],
1140  ],
1141  ],
1142  ],
1143  [
1144  'formElements' => [
1145  'Text' => [
1146  'propertyPaths' => [
1147  'properties.foo',
1148  'properties.bar',
1149  ],
1150  ],
1151  ],
1152  ],
1153  ],
1154 
1155  [
1156  [
1157  'formElementsDefinition' => [
1158  'Text' => [
1159  'formEditor' => [
1160  'editors' => [
1161  [
1162  'templateName' => 'Inspector-GridColumnViewPortConfigurationEditor',
1163  'propertyPath' => 'properties.{@viewPortIdentifier}.foo',
1164  'configurationOptions' => [
1165  'viewPorts' => [
1166  ['viewPortIdentifier' => 'viewFoo'],
1167  ['viewPortIdentifier' => 'viewBar'],
1168  ],
1169  ],
1170  ],
1171  ],
1172  ],
1173  ],
1174  ],
1175  ],
1176  [
1177  'formElements' => [
1178  'Text' => [
1179  'propertyPaths' => [
1180  'properties.viewFoo.foo',
1181  'properties.viewBar.foo',
1182  ],
1183  ],
1184  ],
1185  ],
1186  ],
1187 
1188  [
1189  [
1190  'formElementsDefinition' => [
1191  'Text' => [
1192  'formEditor' => [
1193  'editors' => [
1194  [
1195  'additionalElementPropertyPaths' => [
1196  'properties.foo',
1197  'properties.bar',
1198  ],
1199  ],
1200  ],
1201  ],
1202  ],
1203  ],
1204  ],
1205  [
1206  'formElements' => [
1207  'Text' => [
1208  'additionalElementPropertyPaths' => [
1209  'properties.foo',
1210  'properties.bar',
1211  ],
1212  ],
1213  ],
1214  ],
1215  ],
1216 
1217  [
1218  [
1219  'formElementsDefinition' => [
1220  'Text' => [
1221  'formEditor' => [
1222  'editors' => [
1223  [
1224  'templateName' => 'Inspector-PropertyGridEditor',
1225  'propertyPath' => 'properties.foo.1',
1226  ],
1227  [
1228  'templateName' => 'Inspector-MultiSelectEditor',
1229  'propertyPath' => 'properties.foo.2',
1230  ],
1231  [
1232  'templateName' => 'Inspector-ValidationErrorMessageEditor',
1233  'propertyPath' => 'properties.foo.3',
1234  ],
1235  [
1236  'templateName' => 'Inspector-RequiredValidatorEditor',
1237  'propertyPath' => 'properties.fluidAdditionalAttributes.required',
1238  'configurationOptions' => [
1239  'validationErrorMessage' => [
1240  'propertyPath' => 'properties.validationErrorMessages',
1241  ],
1242  ],
1243  ],
1244  ],
1245  ],
1246  ],
1247  ],
1248  ],
1249  [
1250  'formElements' => [
1251  'Text' => [
1252  'multiValueProperties' => [
1253  'properties.foo.1',
1254  'defaultValue',
1255  'properties.foo.2',
1256  'properties.foo.3',
1257  'properties.validationErrorMessages',
1258  ],
1259  'propertyPaths' => [
1260  'properties.foo.1',
1261  'properties.foo.2',
1262  'properties.foo.3',
1263  'properties.fluidAdditionalAttributes.required',
1264  'properties.validationErrorMessages',
1265  ],
1266  ],
1267  ],
1268  ],
1269  ],
1270 
1271  [
1272  [
1273  'formElementsDefinition' => [
1274  'Text' => [
1275  'formEditor' => [
1276  'predefinedDefaults' => [
1277  'foo' => [
1278  'bar' => 'xxx',
1279  ],
1280  ],
1281  ],
1282  ],
1283  ],
1284  ],
1285  [
1286  'formElements' => [
1287  'Text' => [
1288  'predefinedDefaults' => [
1289  'foo.bar' => 'xxx',
1290  ],
1291  'untranslatedPredefinedDefaults' => [
1292  'foo.bar' => 'xxx',
1293  ],
1294  ],
1295  ],
1296  ],
1297  ],
1298 
1299  [
1300  [
1301  'formEditor' => [
1302  'formElementGroups' => [
1303  'Dummy' => [],
1304  ],
1305  ],
1306  'formElementsDefinition' => [
1307  'Text' => [
1308  'formEditor' => [
1309  'group' => 'Dummy',
1310  'groupSorting' => 10,
1311  ],
1312  ],
1313  ],
1314  ],
1315  [
1316  'formElements' => [
1317  'Text' => [
1318  'creatable' => true,
1319  ],
1320  ],
1321  ],
1322  ],
1323 
1324  [
1325  [
1326  'formEditor' => [
1327  'formElementGroups' => [
1328  'Dummy' => [],
1329  ],
1330  ],
1331  'formElementsDefinition' => [
1332  'Text' => [
1333  'formEditor' => [
1334  'group' => 'Dummy',
1335  ],
1336  ],
1337  ],
1338  ],
1339  [
1340  'formElements' => [
1341  'Text' => [
1342  'creatable' => false,
1343  ],
1344  ],
1345  ],
1346  ],
1347 
1348  [
1349  [
1350  'formEditor' => [
1351  'formElementGroups' => [
1352  'Foo' => [],
1353  ],
1354  ],
1355  'formElementsDefinition' => [
1356  'Text' => [
1357  'formEditor' => [
1358  'group' => 'Dummy',
1359  'groupSorting' => 10,
1360  ],
1361  ],
1362  ],
1363  ],
1364  [
1365  'formElements' => [
1366  'Text' => [
1367  'creatable' => false,
1368  ],
1369  ],
1370  ],
1371  ],
1372 
1373  [
1374  [
1375  'formEditor' => [
1376  'formElementGroups' => [
1377  'Dummy' => [],
1378  ],
1379  ],
1380  'formElementsDefinition' => [
1381  'Text' => [
1382  'formEditor' => [
1383  'group' => 'Foo',
1384  'groupSorting' => 10,
1385  ],
1386  ],
1387  ],
1388  ],
1389  [
1390  'formElements' => [
1391  'Text' => [
1392  'creatable' => false,
1393  ],
1394  ],
1395  ],
1396  ],
1397 
1398  [
1399  [
1400  'formElementsDefinition' => [
1401  'Text' => [
1402  'formEditor' => [
1403  'editors' => [
1404  [
1405  'templateName' => 'Inspector-FinishersEditor',
1406  'selectOptions' => [
1407  [
1408  'value' => 'FooFinisher',
1409  ],
1410  [
1411  'value' => 'BarFinisher',
1412  ],
1413  ],
1414  ],
1415  [
1416  'templateName' => 'Inspector-ValidatorsEditor',
1417  'selectOptions' => [
1418  [
1419  'value' => 'FooValidator',
1420  ],
1421  [
1422  'value' => 'BarValidator',
1423  ],
1424  ],
1425  ],
1426  [
1427  'templateName' => 'Inspector-RequiredValidatorEditor',
1428  'validatorIdentifier' => 'NotEmpty',
1429  ],
1430  ],
1431  ],
1432  ],
1433  ],
1434  ],
1435  [
1436  'formElements' => [
1437  'Text' => [
1438  'collections' => [
1439  'finishers' => [
1440  'FooFinisher' => [
1441  'creatable' => true,
1442  ],
1443  'BarFinisher' => [
1444  'creatable' => true,
1445  ],
1446  ],
1447  'validators' => [
1448  'FooValidator' => [
1449  'creatable' => true,
1450  ],
1451  'BarValidator' => [
1452  'creatable' => true,
1453  ],
1454  'NotEmpty' => [
1455  'creatable' => true,
1456  ],
1457  ],
1458  ],
1459  'selectOptions' => [
1460  '_finishers' => [
1461  'FooFinisher',
1462  'BarFinisher',
1463  ],
1464  '_validators' => [
1465  'FooValidator',
1466  'BarValidator',
1467  ],
1468  ],
1469  'untranslatedSelectOptions' => [
1470  '_finishers' => [
1471  'FooFinisher',
1472  'BarFinisher',
1473  ],
1474  '_validators' => [
1475  'FooValidator',
1476  'BarValidator',
1477  ],
1478  ],
1479  ],
1480  ],
1481  ],
1482  ],
1483 
1484  [
1485  [
1486  'formElementsDefinition' => [
1487  'Text' => [
1488  'formEditor' => [
1489  'propertyCollections' => [
1490  'validators' => [
1491  [
1492  'identifier' => 'fooValidator',
1493  'editors' => [
1494  [
1495  'propertyPath' => 'options.xxx',
1496  ],
1497  [
1498  'propertyPath' => 'options.yyy',
1499  'setup' => [
1500  'propertyPath' => 'options.zzz',
1501  ],
1502  ],
1503  ],
1504  ],
1505  ],
1506  ],
1507  ],
1508  ],
1509  ],
1510  ],
1511  [
1512  'formElements' => [
1513  'Text' => [
1514  'collections' => [
1515  'validators' => [
1516  'fooValidator' => [
1517  'propertyPaths' => [
1518  'options.xxx',
1519  'options.yyy',
1520  'options.zzz',
1521  ],
1522  ],
1523  ],
1524  ],
1525  ],
1526  ],
1527  ],
1528  ],
1529 
1530  [
1531  [
1532  'formElementsDefinition' => [
1533  'Text' => [
1534  'formEditor' => [
1535  'propertyCollections' => [
1536  'validators' => [
1537  [
1538  'identifier' => 'fooValidator',
1539  'editors' => [
1540  [
1541  'additionalElementPropertyPaths' => [
1542  'options.xxx',
1543  ],
1544  ],
1545  [
1546  'additionalElementPropertyPaths' => [
1547  'options.yyy',
1548  'options.zzz',
1549  ],
1550  ],
1551  ],
1552  ],
1553  ],
1554  ],
1555  ],
1556  ],
1557  ],
1558  ],
1559  [
1560  'formElements' => [
1561  'Text' => [
1562  'additionalElementPropertyPaths' => [
1563  'options.xxx',
1564  'options.yyy',
1565  'options.zzz',
1566  ],
1567  ],
1568  ],
1569  ],
1570  ],
1571 
1572  [
1573  [
1574  'formElementsDefinition' => [
1575  'Text' => [
1576  'formEditor' => [
1577  'propertyCollections' => [
1578  'validators' => [
1579  [
1580  'identifier' => 'fooValidator',
1581  'editors' => [
1582  [
1583  'templateName' => 'Inspector-PropertyGridEditor',
1584  'propertyPath' => 'options.xxx',
1585  ],
1586  [
1587  'templateName' => 'Inspector-MultiSelectEditor',
1588  'propertyPath' => 'options.yyy',
1589  ],
1590  [
1591  'templateName' => 'Inspector-ValidationErrorMessageEditor',
1592  'propertyPath' => 'options.zzz',
1593  ],
1594  ],
1595  ],
1596  ],
1597  ],
1598  ],
1599  ],
1600  ],
1601  ],
1602  [
1603  'formElements' => [
1604  'Text' => [
1605  'collections' => [
1606  'validators' => [
1607  'fooValidator' => [
1608  'multiValueProperties' => [
1609  'options.xxx',
1610  'defaultValue',
1611  'options.yyy',
1612  ],
1613  'propertyPaths' => [
1614  'options.xxx',
1615  'options.yyy',
1616  'options.zzz',
1617  ],
1618  ],
1619  ],
1620  ],
1621  'multiValueProperties' => [
1622  'options.zzz',
1623  ],
1624  ],
1625  ],
1626  ],
1627  ],
1628 
1629  [
1630  [
1631  'validatorsDefinition' => [
1632  'someValidator' => [
1633  'formEditor' => [
1634  'predefinedDefaults' => [
1635  'some' => [
1636  'property' => 'value',
1637  ],
1638  ],
1639  ],
1640  ],
1641  ],
1642  ],
1643  [
1644  'collections' => [
1645  'validators' => [
1646  'someValidator' => [
1647  'predefinedDefaults' => [
1648  'some.property' => 'value',
1649  ],
1650  'untranslatedPredefinedDefaults' => [
1651  'some.property' => 'value',
1652  ],
1653  ],
1654  ],
1655  ],
1656  ],
1657  ],
1658  ];
1659  }
1660 }
‪TYPO3\CMS\Form\Service\TranslationService
Definition: TranslationService.php:45
‪TYPO3\CMS\Form\Domain\Configuration\Exception\PrototypeNotFoundException
Definition: PrototypeNotFoundException.php:25
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\addAdditionalPropertyPathsFromHookThrowsExceptionIfPropertyCollectionNameIsInvalid
‪addAdditionalPropertyPathsFromHookThrowsExceptionIfPropertyCollectionNameIsInvalid()
Definition: ConfigurationServiceTest.php:438
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getAllowedValuesForFormElementPropertyFromFormEditorSetupThrowsExceptionIfNoLimitedAllowedValuesAreAvailable
‪getAllowedValuesForFormElementPropertyFromFormEditorSetupThrowsExceptionIfNoLimitedAllowedValuesAreAvailable()
Definition: ConfigurationServiceTest.php:611
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\addAdditionalPropertyPathsFromHookThrowsExceptionIfHookResultIsNoFormDefinitionValidation
‪addAdditionalPropertyPathsFromHookThrowsExceptionIfHookResultIsNoFormDefinitionValidation()
Definition: ConfigurationServiceTest.php:393
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup
‪isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetup(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:177
‪TYPO3\CMS\Form\Domain\Configuration\FormDefinition\Validators\ValidationDto
Definition: ValidationDto.php:23
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\addAdditionalPropertyPathsFromHookThrowsExceptionIfFormElementTypeDoesNotMatch
‪addAdditionalPropertyPathsFromHookThrowsExceptionIfFormElementTypeDoesNotMatch()
Definition: ConfigurationServiceTest.php:418
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetupDataProvider
‪static formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:555
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isPropertyCollectionElementIdentifierCreatableByFormEditorDataProvider
‪static isPropertyCollectionElementIdentifierCreatableByFormEditorDataProvider()
Definition: ConfigurationServiceTest.php:1091
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\buildFormDefinitionValidationConfigurationFromFormEditorSetup
‪buildFormDefinitionValidationConfigurationFromFormEditorSetup(array $configuration, array $expected)
Definition: ConfigurationServiceTest.php:516
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getFormElementPredefinedDefaultValueFromFormEditorSetupThrowsExceptionIfNoPredefinedDefaultIsAvailable
‪getFormElementPredefinedDefaultValueFromFormEditorSetupThrowsExceptionIfNoPredefinedDefaultIsAvailable()
Definition: ConfigurationServiceTest.php:202
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getPrototypeConfigurationThrowsExceptionIfNoPrototypeFound
‪getPrototypeConfigurationThrowsExceptionIfNoPrototypeFound()
Definition: ConfigurationServiceTest.php:56
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isFormElementPropertyDefinedInFormEditorSetup
‪isFormElementPropertyDefinedInFormEditorSetup(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:105
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration
Definition: ConfigurationServiceTest.php:18
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\addAdditionalPropertyPathsFromHookAddPaths
‪addAdditionalPropertyPathsFromHookAddPaths()
Definition: ConfigurationServiceTest.php:458
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\addAdditionalPropertyPathsFromHookThrowsExceptionIfPrototypeDoesNotMatch
‪addAdditionalPropertyPathsFromHookThrowsExceptionIfPrototypeDoesNotMatch()
Definition: ConfigurationServiceTest.php:405
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getAllowedValuesForFormElementPropertyFromFormEditorSetup
‪getAllowedValuesForFormElementPropertyFromFormEditorSetup(array $configuration, ValidationDto $validationDto, array $expectedReturn)
Definition: ConfigurationServiceTest.php:659
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getSelectablePrototypeNamesDefinedInFormEditorSetupReturnsPrototypes
‪getSelectablePrototypeNamesDefinedInFormEditorSetupReturnsPrototypes()
Definition: ConfigurationServiceTest.php:74
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetupDataProvider
‪static isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:1018
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\$resetSingletonInstances
‪bool $resetSingletonInstances
Definition: ConfigurationServiceTest.php:32
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\buildFormDefinitionValidationConfigurationFromFormEditorSetupDataProvider
‪static buildFormDefinitionValidationConfigurationFromFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:1122
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getAllowedValuesForFormElementPropertyFromFormEditorSetupDataProvider
‪static getAllowedValuesForFormElementPropertyFromFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:631
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getPropertyCollectionPredefinedDefaultValueFromFormEditorSetupReturnsDefaultValue
‪getPropertyCollectionPredefinedDefaultValueFromFormEditorSetupReturnsDefaultValue()
Definition: ConfigurationServiceTest.php:282
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getPrototypeConfigurationReturnsPrototypeConfiguration
‪getPrototypeConfigurationReturnsPrototypeConfiguration()
Definition: ConfigurationServiceTest.php:35
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetupThrowsExceptionIfNoLimitedAllowedValuesAreAvailable
‪getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetupThrowsExceptionIfNoLimitedAllowedValuesAreAvailable()
Definition: ConfigurationServiceTest.php:737
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest
Definition: ConfigurationServiceTest.php:31
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetup
‪getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetup(array $configuration, ValidationDto $validationDto, array $expectedReturn)
Definition: ConfigurationServiceTest.php:785
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getPropertyCollectionPredefinedDefaultValueFromFormEditorSetupThrowsExceptionIfNoPredefinedDefaultIsAvailable
‪getPropertyCollectionPredefinedDefaultValueFromFormEditorSetupThrowsExceptionIfNoPredefinedDefaultIsAvailable()
Definition: ConfigurationServiceTest.php:254
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isPropertyCollectionPropertyDefinedInFormEditorSetup
‪isPropertyCollectionPropertyDefinedInFormEditorSetup(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:129
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getFormElementPredefinedDefaultValueFromFormEditorSetupReturnsDefaultValue
‪getFormElementPredefinedDefaultValueFromFormEditorSetupReturnsDefaultValue()
Definition: ConfigurationServiceTest.php:223
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isFormElementTypeDefinedInFormSetup
‪isFormElementTypeDefinedInFormSetup()
Definition: ConfigurationServiceTest.php:368
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetupDataProvider
‪static propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:681
‪TYPO3\CMS\Form\Domain\Configuration\ConfigurationService
Definition: ConfigurationService.php:50
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isPropertyCollectionElementIdentifierCreatableByFormEditor
‪isPropertyCollectionElementIdentifierCreatableByFormEditor(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:345
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isPropertyCollectionPropertyDefinedInFormEditorSetupDataProvider
‪static isPropertyCollectionPropertyDefinedInFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:888
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isFormElementPropertyDefinedInFormEditorSetupDataProvider
‪static isFormElementPropertyDefinedInFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:807
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup
‪formElementPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:588
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup
‪isFormElementPropertyDefinedInPredefinedDefaultsInFormEditorSetup(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:153
‪TYPO3\CMS\Form\Mvc\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_YAML_SETTINGS
‪const CONFIGURATION_TYPE_YAML_SETTINGS
Definition: ConfigurationManagerInterface.php:30
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isFormElementTypeCreatableByFormEditorDataProvider
‪static isFormElementTypeCreatableByFormEditorDataProvider()
Definition: ConfigurationServiceTest.php:1065
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup
‪propertyCollectionPropertyHasLimitedAllowedValuesDefinedWithinFormEditorSetup(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:714
‪TYPO3\CMS\Form\Domain\Configuration\Exception\PropertyException
Definition: PropertyException.php:25
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isFormElementTypeCreatableByFormEditor
‪isFormElementTypeCreatableByFormEditor(array $configuration, ValidationDto $validationDto, bool $expectedReturn)
Definition: ConfigurationServiceTest.php:321
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetupDataProvider
‪static isPropertyCollectionPropertyDefinedInPredefinedDefaultsInFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:1039
‪TYPO3\CMS\Form\Tests\Unit\Domain\Configuration\ConfigurationServiceTest\getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetupDataProvider
‪static getAllowedValuesForPropertyCollectionPropertyFromFormEditorSetupDataProvider()
Definition: ConfigurationServiceTest.php:757
‪TYPO3\CMS\Form\Mvc\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:29