‪TYPO3CMS  ‪main
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 
20 use PHPUnit\Framework\Attributes\Test;
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
24 final class ‪TcaColumnsProcessRecordTitleTest extends UnitTestCase
25 {
26  #[Test]
27  public function ‪addDataRegistersLabelColumn(): void
28  {
29  $input = [
30  'columnsToProcess' => [],
31  'isInlineChild' => false,
32  'processedTca' => [
33  'ctrl' => [
34  'label' => 'uid',
35  ],
36  'columns' => [],
37  ],
38  ];
39 
40  $expected = $input;
41  $expected['columnsToProcess'] = ['uid'];
42  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
43  }
44 
45  #[Test]
47  {
48  $input = [
49  'columnsToProcess' => [],
50  'isInlineChild' => false,
51  'processedTca' => [
52  'ctrl' => [
53  'label' => 'uid',
54  'label_alt' => 'aField,anotherField',
55  ],
56  'columns' => [],
57  ],
58  ];
59 
60  $expected = $input;
61  $expected['columnsToProcess'] = ['uid', 'aField', 'anotherField'];
62  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
63  }
64 
65  #[Test]
67  {
68  $input = [
69  'columnsToProcess' => [],
70  'inlineParentConfig' => [
71  'foreign_label' => 'aForeignLabelField',
72  ],
73  'isInlineChild' => true,
74  ];
75 
76  $expected = $input;
77  $expected['columnsToProcess'] = [ 'aForeignLabelField' ];
78  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
79  }
80 
81  #[Test]
83  {
84  $input = [
85  'columnsToProcess' => [],
86  'inlineParentConfig' => [
87  'symmetric_label' => 'aSymmetricLabelField',
88  ],
89  'isInlineChild' => true,
90  ];
91 
92  $expected = $input;
93  $expected['columnsToProcess'] = [ 'aSymmetricLabelField' ];
94  self::assertSame($expected, (new ‪TcaColumnsProcessRecordTitle())->addData($input));
95  }
96 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersAlternativeLabelColumn
‪addDataRegistersAlternativeLabelColumn()
Definition: TcaColumnsProcessRecordTitleTest.php:46
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersSymmetricLabelInInlineContext
‪addDataRegistersSymmetricLabelInInlineContext()
Definition: TcaColumnsProcessRecordTitleTest.php:82
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessRecordTitle
Definition: TcaColumnsProcessRecordTitle.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersLabelColumn
‪addDataRegistersLabelColumn()
Definition: TcaColumnsProcessRecordTitleTest.php:27
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest\addDataRegistersForeignLabelInInlineContext
‪addDataRegistersForeignLabelInInlineContext()
Definition: TcaColumnsProcessRecordTitleTest.php:66
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessRecordTitleTest
Definition: TcaColumnsProcessRecordTitleTest.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18