‪TYPO3CMS  11.5
TcaColumnsProcessRecordTitleTest.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 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
26 class ‪TcaColumnsProcessRecordTitleTest extends UnitTestCase
27 {
31  public function ‪addDataRegistersLabelColumn(): void
32  {
33  $input = [
34  'columnsToProcess' => [],
35  'isInlineChild' => false,
36  'processedTca' => [
37  'ctrl' => [
38  'label' => 'uid',
39  ],
40  'columns' => [],
41  ],
42  ];
43 
44  $expected = $input;
45  $expected['columnsToProcess'] = ['uid'];
46  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
47  }
48 
53  {
54  $input = [
55  'columnsToProcess' => [],
56  'isInlineChild' => false,
57  'processedTca' => [
58  'ctrl' => [
59  'label' => 'uid',
60  'label_alt' => 'aField,anotherField',
61  ],
62  'columns' => [],
63  ],
64  ];
65 
66  $expected = $input;
67  $expected['columnsToProcess'] = ['uid', 'aField', 'anotherField'];
68  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
69  }
70 
75  {
76  $input = [
77  'columnsToProcess' => [],
78  'inlineParentConfig' => [
79  'foreign_label' => 'aForeignLabelField',
80  ],
81  'isInlineChild' => true,
82  ];
83 
84  $expected = $input;
85  $expected['columnsToProcess'] = [ 'aForeignLabelField' ];
86  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
87  }
88 
93  {
94  $input = [
95  'columnsToProcess' => [],
96  'inlineParentConfig' => [
97  'symmetric_label' => 'aSymmetricLabelField',
98  ],
99  'isInlineChild' => true,
100  ];
101 
102  $expected = $input;
103  $expected['columnsToProcess'] = [ 'aSymmetricLabelField' ];
104  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
105  }
106 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersAlternativeLabelColumn
‪addDataRegistersAlternativeLabelColumn()
Definition: TcaColumnsProcessRecordTitleTest.php:52
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersSymmetricLabelInInlineContext
‪addDataRegistersSymmetricLabelInInlineContext()
Definition: TcaColumnsProcessRecordTitleTest.php:92
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessRecordTitle
Definition: TcaColumnsProcessRecordTitle.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersLabelColumn
‪addDataRegistersLabelColumn()
Definition: TcaColumnsProcessRecordTitleTest.php:31
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersForeignLabelInInlineContext
‪addDataRegistersForeignLabelInInlineContext()
Definition: TcaColumnsProcessRecordTitleTest.php:74
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest
Definition: TcaColumnsProcessRecordTitleTest.php:27
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18