b5aa0752af0b01f4d6d7e9eb6854c640ff27f6c6
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Tests / Unit / Form / FormDataProvider / TcaInlineConfigurationTest.php
1 <?php
2 namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Form\FormDataProvider\TcaInlineConfiguration;
18 use TYPO3\CMS\Core\Tests\UnitTestCase;
19
20 /**
21 * Test case
22 */
23 class TcaInlineConfigurationTest extends UnitTestCase
24 {
25 /**
26 * @var TcaInlineConfiguration
27 */
28 protected $subject;
29
30 protected function setUp()
31 {
32 $this->subject = new TcaInlineConfiguration();
33 }
34
35 /**
36 * @var array Set of default controls
37 */
38 protected $defaultConfig = [
39 'type' => 'inline',
40 'foreign_table' => 'aForeignTableName',
41 'minitems' => 0,
42 'maxitems' => 100000,
43 'behaviour' => [
44 'localizationMode' => 'none',
45 ],
46 'appearance' => [
47 'levelLinksPosition' => 'top',
48 'showPossibleLocalizationRecords' => false,
49 'showRemovedLocalizationRecords' => false,
50 'enabledControls' => [
51 'info' => true,
52 'new' => true,
53 'dragdrop' => true,
54 'sort' => true,
55 'hide' => true,
56 'delete' => true,
57 'localize' => true,
58 ],
59 ],
60 ];
61
62 /**
63 * @test
64 */
65 public function addDataThrowsExceptionForInlineFieldWithoutForeignTableConfig()
66 {
67 $input = [
68 'databaseRow' => [],
69 'processedTca' => [
70 'columns' => [
71 'aField' => [
72 'config' => [
73 'type' => 'inline',
74 ],
75 ],
76 ],
77 ],
78 ];
79 $this->expectException(\UnexpectedValueException::class);
80 $this->expectExceptionCode(1443793404);
81 $this->subject->addData($input);
82 }
83
84 /**
85 * @test
86 */
87 public function addDataSetsDefaults()
88 {
89 $input = [
90 'processedTca' => [
91 'columns' => [
92 'aField' => [
93 'config' => [
94 'type' => 'inline',
95 'foreign_table' => 'aForeignTableName',
96 ],
97 ],
98 ],
99 ],
100 ];
101 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
102 $this->assertEquals($expected, $this->subject->addData($input));
103 }
104
105 /**
106 * @test
107 */
108 public function addDataKeepsGivenMinitems()
109 {
110 $input = [
111 'processedTca' => [
112 'columns' => [
113 'aField' => [
114 'config' => [
115 'type' => 'inline',
116 'foreign_table' => 'aForeignTableName',
117 'minitems' => 23,
118 ],
119 ],
120 ],
121 ],
122 ];
123 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
124 $expected['processedTca']['columns']['aField']['config']['minitems'] = 23;
125 $this->assertEquals($expected, $this->subject->addData($input));
126 }
127
128 /**
129 * @test
130 */
131 public function addDataForcesMinitemsPositive()
132 {
133 $input = [
134 'processedTca' => [
135 'columns' => [
136 'aField' => [
137 'config' => [
138 'type' => 'inline',
139 'foreign_table' => 'aForeignTableName',
140 'minitems' => '-23',
141 ],
142 ],
143 ],
144 ],
145 ];
146 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
147 $expected['processedTca']['columns']['aField']['config']['minitems'] = 0;
148 $this->assertEquals($expected, $this->subject->addData($input));
149 }
150
151 /**
152 * @test
153 */
154 public function addDataKeepsGivenMaxitems()
155 {
156 $input = [
157 'processedTca' => [
158 'columns' => [
159 'aField' => [
160 'config' => [
161 'type' => 'inline',
162 'foreign_table' => 'aForeignTableName',
163 'maxitems' => 23,
164 ],
165 ],
166 ],
167 ],
168 ];
169 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
170 $expected['processedTca']['columns']['aField']['config']['maxitems'] = 23;
171 $this->assertEquals($expected, $this->subject->addData($input));
172 }
173
174 /**
175 * @test
176 */
177 public function addDataForcesMaxitemsPositive()
178 {
179 $input = [
180 'processedTca' => [
181 'columns' => [
182 'aField' => [
183 'config' => [
184 'type' => 'inline',
185 'foreign_table' => 'aForeignTableName',
186 'maxitems' => '-23',
187 ],
188 ],
189 ],
190 ],
191 ];
192 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
193 $expected['processedTca']['columns']['aField']['config']['maxitems'] = 1;
194 $this->assertEquals($expected, $this->subject->addData($input));
195 }
196
197 /**
198 * @test
199 */
200 public function addDataThrowsExceptionIfLocalizationModeIsSetButNotToKeepOrSelect()
201 {
202 $input = [
203 'defaultLanguageRow' => [],
204 'processedTca' => [
205 'columns' => [
206 'aField' => [
207 'config' => [
208 'type' => 'inline',
209 'foreign_table' => 'aForeignTableName',
210 'behaviour' => [
211 'localizationMode' => 'foo',
212 ]
213 ],
214 ],
215 ],
216 ],
217 ];
218 $this->expectException(\UnexpectedValueException::class);
219 $this->expectExceptionCode(1443829370);
220 $this->subject->addData($input);
221 }
222
223 /**
224 * @test
225 */
226 public function addDataThrowsExceptionIfLocalizationModeIsSetToSelectAndChildIsNotLocalizable()
227 {
228 $input = [
229 'defaultLanguageRow' => [],
230 'processedTca' => [
231 'columns' => [
232 'aField' => [
233 'config' => [
234 'type' => 'inline',
235 'foreign_table' => 'aForeignTableName',
236 'behaviour' => [
237 'localizationMode' => 'select',
238 ]
239 ],
240 ],
241 ],
242 ],
243 ];
244 // not $globals definition for child here -> not localizable
245 $this->expectException(\UnexpectedValueException::class);
246 $this->expectExceptionCode(1443944274);
247 $this->subject->addData($input);
248 }
249
250 /**
251 * @test
252 */
253 public function addDataKeepsLocalizationModeSelectIfChildIsLocalizable()
254 {
255 $input = [
256 'defaultLanguageRow' => [],
257 'processedTca' => [
258 'columns' => [
259 'aField' => [
260 'config' => [
261 'type' => 'inline',
262 'foreign_table' => 'aForeignTableName',
263 'behaviour' => [
264 'localizationMode' => 'select',
265 ]
266 ],
267 ],
268 ],
269 ],
270 ];
271 $GLOBALS['TCA']['aForeignTableName']['ctrl'] = [
272 'languageField' => 'theLanguageField',
273 'transOrigPointerField' => 'theTransOrigPointerField',
274 ];
275 $expected = $input;
276 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
277 $expected['processedTca']['columns']['aField']['config']['behaviour']['localizationMode'] = 'select';
278 $this->assertEquals($expected, $this->subject->addData($input));
279 }
280
281 /**
282 * @test
283 */
284 public function addDataKeepsLocalizationModeKeep()
285 {
286 $input = [
287 'defaultLanguageRow' => [],
288 'processedTca' => [
289 'columns' => [
290 'aField' => [
291 'config' => [
292 'type' => 'inline',
293 'foreign_table' => 'aForeignTableName',
294 'behaviour' => [
295 'localizationMode' => 'keep',
296 ]
297 ],
298 ],
299 ],
300 ],
301 ];
302 $expected = $input;
303 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
304 $expected['processedTca']['columns']['aField']['config']['behaviour']['localizationMode'] = 'keep';
305 $this->assertEquals($expected, $this->subject->addData($input));
306 }
307
308 /**
309 * @test
310 */
311 public function addDataSetsLocalizationModeToNoneIfNotSetAndChildIsNotLocalizable()
312 {
313 $input = [
314 'defaultLanguageRow' => [],
315 'processedTca' => [
316 'columns' => [
317 'aField' => [
318 'config' => [
319 'type' => 'inline',
320 'foreign_table' => 'aForeignTableName',
321 ],
322 ],
323 ],
324 ],
325 ];
326 $expected = $input;
327 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
328 $expected['processedTca']['columns']['aField']['config']['behaviour']['localizationMode'] = 'none';
329 $this->assertEquals($expected, $this->subject->addData($input));
330 }
331
332 /**
333 * @test
334 */
335 public function addDataSetsLocalizationModeToSelectIfNotSetAndChildIsLocalizable()
336 {
337 $input = [
338 'defaultLanguageRow' => [],
339 'processedTca' => [
340 'columns' => [
341 'aField' => [
342 'config' => [
343 'type' => 'inline',
344 'foreign_table' => 'aForeignTableName',
345 ],
346 ],
347 ],
348 ],
349 ];
350 $GLOBALS['TCA']['aForeignTableName']['ctrl'] = [
351 'languageField' => 'theLanguageField',
352 'transOrigPointerField' => 'theTransOrigPointerField',
353 ];
354 $expected = $input;
355 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
356 $expected['processedTca']['columns']['aField']['config']['behaviour']['localizationMode'] = 'select';
357 $this->assertEquals($expected, $this->subject->addData($input));
358 }
359
360 /**
361 * @test
362 */
363 public function addDataMergesWithGivenAppearanceSettings()
364 {
365 $input = [
366 'processedTca' => [
367 'columns' => [
368 'aField' => [
369 'config' => [
370 'type' => 'inline',
371 'foreign_table' => 'aForeignTableName',
372 'appearance' => [
373 'levelLinksPosition' => 'both',
374 'enabledControls' => [
375 'dragdrop' => false,
376 ],
377 ],
378 ],
379 ],
380 ],
381 ],
382 ];
383 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
384 $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'both';
385 $expected['processedTca']['columns']['aField']['config']['appearance']['enabledControls']['dragdrop'] = false;
386 $this->assertEquals($expected, $this->subject->addData($input));
387 }
388
389 /**
390 * @test
391 */
392 public function addDataForcesLevelLinksPositionWithForeignSelector()
393 {
394 $input = [
395 'processedTca' => [
396 'columns' => [
397 'aField' => [
398 'config' => [
399 'type' => 'inline',
400 'foreign_table' => 'aForeignTableName',
401 'foreign_selector' => 'aField',
402 'appearance' => [
403 'levelLinksPosition' => 'both',
404 ],
405 ],
406 ],
407 ],
408 ],
409 ];
410 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
411 'type' => 'select',
412 'foreign_table' => 'anotherForeignTableName',
413 ];
414 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
415 $expected['processedTca']['columns']['aField']['config']['foreign_selector'] = 'aField';
416 $expected['processedTca']['columns']['aField']['config']['selectorOrUniqueConfiguration'] = [
417 'fieldName' => 'aField',
418 'isSelector' => true,
419 'isUnique' => false,
420 'config' => [
421 'type' => 'select',
422 'foreign_table' => 'anotherForeignTableName',
423 ],
424 'foreignTable' => 'anotherForeignTableName',
425 ];
426 $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'none';
427 $this->assertEquals($expected, $this->subject->addData($input));
428 }
429
430 /**
431 * @test
432 */
433 public function addDataKeepsLevelLinksPositionWithForeignSelectorAndUseCombination()
434 {
435 $input = [
436 'processedTca' => [
437 'columns' => [
438 'aField' => [
439 'config' => [
440 'type' => 'inline',
441 'foreign_table' => 'aForeignTableName',
442 'foreign_selector' => 'aField',
443 'appearance' => [
444 'useCombination' => true,
445 'levelLinksPosition' => 'both',
446 ],
447 ],
448 ],
449 ],
450 ],
451 ];
452 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
453 'type' => 'select',
454 'foreign_table' => 'anotherForeignTableName',
455 ];
456 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
457 $expected['processedTca']['columns']['aField']['config']['foreign_selector'] = 'aField';
458 $expected['processedTca']['columns']['aField']['config']['selectorOrUniqueConfiguration'] = [
459 'fieldName' => 'aField',
460 'isSelector' => true,
461 'isUnique' => false,
462 'config' => [
463 'type' => 'select',
464 'foreign_table' => 'anotherForeignTableName',
465 ],
466 'foreignTable' => 'anotherForeignTableName',
467 ];
468 $expected['processedTca']['columns']['aField']['config']['appearance']['useCombination'] = true;
469 $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'both';
470 $this->assertEquals($expected, $this->subject->addData($input));
471 }
472
473 /**
474 * @test
475 */
476 public function addDataKeepsShowPossibleLocalizationRecordsButForcesBooleanTrue()
477 {
478 $input = [
479 'processedTca' => [
480 'columns' => [
481 'aField' => [
482 'config' => [
483 'type' => 'inline',
484 'foreign_table' => 'aForeignTableName',
485 'appearance' => [
486 'showPossibleLocalizationRecords' => '1',
487 ],
488 ],
489 ],
490 ],
491 ],
492 ];
493 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
494 $expected['processedTca']['columns']['aField']['config']['appearance']['showPossibleLocalizationRecords'] = true;
495 $this->assertEquals($expected, $this->subject->addData($input));
496 }
497
498 /**
499 * @test
500 */
501 public function addDataKeepsShowPossibleLocalizationRecordsButForcesBooleanFalse()
502 {
503 $input = [
504 'processedTca' => [
505 'columns' => [
506 'aField' => [
507 'config' => [
508 'type' => 'inline',
509 'foreign_table' => 'aForeignTableName',
510 'appearance' => [
511 'showPossibleLocalizationRecords' => 0,
512 ],
513 ],
514 ],
515 ],
516 ],
517 ];
518 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
519 $expected['processedTca']['columns']['aField']['config']['appearance']['showPossibleLocalizationRecords'] = false;
520 $this->assertEquals($expected, $this->subject->addData($input));
521 }
522
523 /**
524 * @test
525 */
526 public function addDataKeepshowRemovedLocalizationRecordsButForcesBooleanTrue()
527 {
528 $input = [
529 'processedTca' => [
530 'columns' => [
531 'aField' => [
532 'config' => [
533 'type' => 'inline',
534 'foreign_table' => 'aForeignTableName',
535 'appearance' => [
536 'showRemovedLocalizationRecords' => 1,
537 ],
538 ],
539 ],
540 ],
541 ],
542 ];
543 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
544 $expected['processedTca']['columns']['aField']['config']['appearance']['showRemovedLocalizationRecords'] = true;
545 $this->assertEquals($expected, $this->subject->addData($input));
546 }
547
548 /**
549 * @test
550 */
551 public function addDataKeepsShowRemovedLocalizationRecordsButForcesBooleanFalse()
552 {
553 $input = [
554 'processedTca' => [
555 'columns' => [
556 'aField' => [
557 'config' => [
558 'type' => 'inline',
559 'foreign_table' => 'aForeignTableName',
560 'appearance' => [
561 'showRemovedLocalizationRecords' => '',
562 ],
563 ],
564 ],
565 ],
566 ],
567 ];
568 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
569 $expected['processedTca']['columns']['aField']['config']['appearance']['showRemovedLocalizationRecords'] = false;
570 $this->assertEquals($expected, $this->subject->addData($input));
571 }
572
573 /**
574 * @test
575 */
576 public function addDataThrowsExceptionIfForeignSelectorAndForeignUniquePointToDifferentFields()
577 {
578 $input = [
579 'processedTca' => [
580 'columns' => [
581 'aField' => [
582 'config' => [
583 'type' => 'inline',
584 'foreign_table' => 'aForeignTableName',
585 'foreign_selector' => 'aField',
586 'foreign_unique' => 'aDifferentField',
587 ],
588 ],
589 ],
590 ],
591 ];
592 $this->expectException(\UnexpectedValueException::class);
593 $this->expectExceptionCode(1444995464);
594 $this->subject->addData($input);
595 }
596
597 /**
598 * @test
599 */
600 public function addDataThrowsExceptionIfForeignSelectorPointsToANotExistingField()
601 {
602 $input = [
603 'processedTca' => [
604 'columns' => [
605 'aField' => [
606 'config' => [
607 'type' => 'inline',
608 'foreign_table' => 'aForeignTableName',
609 'foreign_selector' => 'aField',
610 ],
611 ],
612 ],
613 ],
614 ];
615 $this->expectException(\UnexpectedValueException::class);
616 $this->expectExceptionCode(1444996537);
617 $this->subject->addData($input);
618 }
619
620 /**
621 * @test
622 */
623 public function addDataThrowsExceptionIfForeignUniquePointsToANotExistingField()
624 {
625 $input = [
626 'processedTca' => [
627 'columns' => [
628 'aField' => [
629 'config' => [
630 'type' => 'inline',
631 'foreign_table' => 'aForeignTableName',
632 'foreign_unique' => 'aField',
633 ],
634 ],
635 ],
636 ],
637 ];
638 $this->expectException(\UnexpectedValueException::class);
639 $this->expectExceptionCode(1444996537);
640 $this->subject->addData($input);
641 }
642
643 /**
644 * @test
645 */
646 public function addDataThrowsExceptionIfForeignUniqueTargetIsNotTypeSelectOrGroup()
647 {
648 $input = [
649 'processedTca' => [
650 'columns' => [
651 'aField' => [
652 'config' => [
653 'type' => 'inline',
654 'foreign_table' => 'aForeignTableName',
655 'foreign_unique' => 'aField',
656 ],
657 ],
658 ],
659 ],
660 ];
661 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
662 'type' => 'notSelectOrGroup',
663 ];
664 $this->expectException(\UnexpectedValueException::class);
665 $this->expectExceptionCode(1444996537);
666 $this->subject->addData($input);
667 }
668
669 /**
670 * @test
671 */
672 public function addDataThrowsExceptionForForeignSelectorGroupWithoutInternalTypeDb()
673 {
674 $input = [
675 'processedTca' => [
676 'columns' => [
677 'aField' => [
678 'config' => [
679 'type' => 'inline',
680 'foreign_table' => 'aForeignTableName',
681 'foreign_unique' => 'aField',
682 ],
683 ],
684 ],
685 ],
686 ];
687 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
688 'type' => 'group',
689 'internal_type' => 'notDb'
690 ];
691 $this->expectException(\UnexpectedValueException::class);
692 $this->expectExceptionCode(1444999130);
693 $this->subject->addData($input);
694 }
695
696 /**
697 * @test
698 */
699 public function addDataThrowsExceptionIfForeignUniqueSelectDoesNotDefineForeignTable()
700 {
701 $input = [
702 'processedTca' => [
703 'columns' => [
704 'aField' => [
705 'config' => [
706 'type' => 'inline',
707 'foreign_table' => 'aForeignTableName',
708 'foreign_unique' => 'aField',
709 ],
710 ],
711 ],
712 ],
713 ];
714 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
715 'type' => 'select',
716 ];
717 $this->expectException(\UnexpectedValueException::class);
718 $this->expectExceptionCode(1445078627);
719 $this->subject->addData($input);
720 }
721
722 /**
723 * @test
724 */
725 public function addDataThrowsExceptionIfForeignUniqueGroupDoesNotDefineForeignTable()
726 {
727 $input = [
728 'processedTca' => [
729 'columns' => [
730 'aField' => [
731 'config' => [
732 'type' => 'inline',
733 'foreign_table' => 'aForeignTableName',
734 'foreign_unique' => 'aField',
735 ],
736 ],
737 ],
738 ],
739 ];
740 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
741 'type' => 'group',
742 'internal_type' => 'db',
743 ];
744 $this->expectException(\UnexpectedValueException::class);
745 $this->expectExceptionCode(1445078628);
746 $this->subject->addData($input);
747 }
748
749 /**
750 * @test
751 */
752 public function addDataAddsSelectorOrUniqueConfigurationForForeignUnique()
753 {
754 $input = [
755 'processedTca' => [
756 'columns' => [
757 'aField' => [
758 'config' => [
759 'type' => 'inline',
760 'foreign_table' => 'aForeignTableName',
761 'foreign_unique' => 'aField',
762 ],
763 ],
764 ],
765 ],
766 ];
767 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
768 'type' => 'select',
769 'foreign_table' => 'anotherForeignTableName',
770 ];
771 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
772 $expected['processedTca']['columns']['aField']['config']['foreign_unique'] = 'aField';
773 $expected['processedTca']['columns']['aField']['config']['selectorOrUniqueConfiguration'] = [
774 'fieldName' => 'aField',
775 'isSelector' => false,
776 'isUnique' => true,
777 'config' => [
778 'type' => 'select',
779 'foreign_table' => 'anotherForeignTableName',
780 ],
781 'foreignTable' => 'anotherForeignTableName',
782 ];
783 $this->assertEquals($expected, $this->subject->addData($input));
784 }
785
786 /**
787 * @test
788 */
789 public function addDataMergesForeignSelectorFieldTcaOverride()
790 {
791 $input = [
792 'processedTca' => [
793 'columns' => [
794 'aField' => [
795 'config' => [
796 'type' => 'inline',
797 'foreign_table' => 'aForeignTableName',
798 'foreign_selector' => 'aField',
799 'foreign_selector_fieldTcaOverride' => [
800 'config' => [
801 'aGivenSetting' => 'aOverrideValue',
802 'aNewSetting' => 'aNewSetting',
803 'appearance' => [
804 'elementBrowserType' => 'file',
805 'elementBrowserAllowed' => 'jpg,png',
806 ],
807 ],
808 ],
809 ],
810 ],
811 ],
812 ],
813 ];
814 $GLOBALS['TCA']['aForeignTableName']['columns']['aField']['config'] = [
815 'type' => 'group',
816 'internal_type' => 'db',
817 'allowed' => 'anotherForeignTableName',
818 'doNotChangeMe' => 'doNotChangeMe',
819 'aGivenSetting' => 'aGivenValue',
820 ];
821
822 $expected['processedTca']['columns']['aField']['config'] = $this->defaultConfig;
823 $expected['processedTca']['columns']['aField']['config']['appearance']['levelLinksPosition'] = 'none';
824 $expected['processedTca']['columns']['aField']['config']['foreign_selector'] = 'aField';
825 $expected['processedTca']['columns']['aField']['config']['foreign_selector_fieldTcaOverride'] = [
826 'config' => [
827 'aGivenSetting' => 'aOverrideValue',
828 'aNewSetting' => 'aNewSetting',
829 'appearance' => [
830 'elementBrowserType' => 'file',
831 'elementBrowserAllowed' => 'jpg,png',
832 ],
833 ],
834 ];
835
836 $expected['processedTca']['columns']['aField']['config']['selectorOrUniqueConfiguration'] = [
837 'fieldName' => 'aField',
838 'isSelector' => true,
839 'isUnique' => false,
840 'config' => [
841 'type' => 'group',
842 'internal_type' => 'db',
843 'allowed' => 'anotherForeignTableName',
844 'doNotChangeMe' => 'doNotChangeMe',
845 'aGivenSetting' => 'aOverrideValue',
846 'aNewSetting' => 'aNewSetting',
847 'appearance' => [
848 'elementBrowserType' => 'file',
849 'elementBrowserAllowed' => 'jpg,png',
850 ],
851 ],
852 'foreignTable' => 'anotherForeignTableName',
853 ];
854 $this->assertEquals($expected, $this->subject->addData($input));
855 }
856 }