‪TYPO3CMS  9.5
TcaColumnsProcessCommonTest.php
Go to the documentation of this file.
1 <?php
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 
18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
19 
23 class ‪TcaColumnsProcessCommonTest extends UnitTestCase
24 {
29  {
30  $input = [
31  'recordTypeValue' => 'aType',
32  'columnsToProcess' => [],
33  'processedTca' => [
34  'ctrl' => [
35  'origUid' => 't3_origuid'
36  ]
37  ]
38  ];
39 
40  $expected = $input;
41  $expected['columnsToProcess'] = ['t3_origuid'];
42  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
43  }
44 
49  {
50  $input = [
51  'recordTypeValue' => 'aType',
52  'columnsToProcess' => [],
53  'processedTca' => [
54  'ctrl' => [
55  'type' => 'doktype'
56  ]
57  ]
58  ];
59 
60  $expected = $input;
61  $expected['columnsToProcess'] = ['doktype'];
62  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
63  }
64 
69  {
70  $input = [
71  'recordTypeValue' => 'aType',
72  'columnsToProcess' => [],
73  'processedTca' => [
74  'ctrl' => [
75  'type' => 'relation_field:foreign_type_field'
76  ]
77  ]
78  ];
79 
80  $expected = $input;
81  $expected['columnsToProcess'] = ['relation_field'];
82  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
83  }
84 
89  {
90  $input = [
91  'recordTypeValue' => 'aType',
92  'columnsToProcess' => [],
93  'processedTca' => [
94  'ctrl' => [
95  'languageField' => 'sys_language_uid'
96  ]
97  ]
98  ];
99 
100  $expected = $input;
101  $expected['columnsToProcess'] = ['sys_language_uid'];
102  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
103  }
104 
109  {
110  $input = [
111  'recordTypeValue' => 'aType',
112  'columnsToProcess' => [],
113  'processedTca' => [
114  'ctrl' => [
115  'transOrigPointerField' => 'l10n_parent'
116  ]
117  ]
118  ];
119 
120  $expected = $input;
121  $expected['columnsToProcess'] = ['l10n_parent'];
122  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
123  }
124 
129  {
130  $input = [
131  'recordTypeValue' => 'aType',
132  'columnsToProcess' => [],
133  'processedTca' => [
134  'ctrl' => [
135  'transOrigDiffSourceField' => 'l18n_diffsource'
136  ]
137  ]
138  ];
139 
140  $expected = $input;
141  $expected['columnsToProcess'] = ['l18n_diffsource'];
142  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
143  }
144 
149  {
150  $input = [
151  'recordTypeValue' => 'list',
152  'columnsToProcess' => [],
153  'processedTca' => [
154  'ctrl' => [],
155  'types' => [
156  'list' => [
157  'subtype_value_field' => 'list_type',
158  'subtypes_addlist' => [
159  'aType' => 'aField',
160  ]
161  ],
162  ],
163  ],
164  'databaseRow' => [
165  'list_type' => 'aType',
166  ],
167  ];
168 
169  $expected = $input;
170  $expected['columnsToProcess'] = ['aField'];
171  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
172  }
173 
178  {
179  $input = [
180  'recordTypeValue' => 'aType',
181  'columnsToProcess' => [],
182  'processedTca' => [
183  'ctrl' => [],
184  'types' => [
185  'aType' => [
186  'subtype_value_field' => 'theSubtypeValueField',
187  'subtypes_addlist' => [
188  'theSubtypeValue' => 'aField, bField',
189  ]
190  ],
191  ],
192  ],
193  'databaseRow' => [
194  'theSubtypeValueField' => 'theSubtypeValue',
195  ],
196  ];
197 
198  $expected = $input;
199  $expected['columnsToProcess'] = ['aField', 'bField'];
200  $this->assertSame($expected, (new ‪TcaColumnsProcessCommon)->addData($input));
201  }
202 }
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessCommon
Definition: TcaColumnsProcessCommon.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersMultipleSubtypesAddlistFields
‪addDataRegistersMultipleSubtypesAddlistFields()
Definition: TcaColumnsProcessCommonTest.php:177
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersLanguageFieldColumn
‪addDataRegistersLanguageFieldColumn()
Definition: TcaColumnsProcessCommonTest.php:88
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersRecordTypeRelationColumn
‪addDataRegistersRecordTypeRelationColumn()
Definition: TcaColumnsProcessCommonTest.php:68
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersSingleSubtypesAddlistFields
‪addDataRegistersSingleSubtypesAddlistFields()
Definition: TcaColumnsProcessCommonTest.php:148
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersOrigUidColumn
‪addDataRegistersOrigUidColumn()
Definition: TcaColumnsProcessCommonTest.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersRecordTypeColumn
‪addDataRegistersRecordTypeColumn()
Definition: TcaColumnsProcessCommonTest.php:48
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersTransOrigPointerColumn
‪addDataRegistersTransOrigPointerColumn()
Definition: TcaColumnsProcessCommonTest.php:108
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest\addDataRegistersTransOrigDiffSourceColumn
‪addDataRegistersTransOrigDiffSourceColumn()
Definition: TcaColumnsProcessCommonTest.php:128
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:3
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessCommonTest
Definition: TcaColumnsProcessCommonTest.php:24