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