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