TYPO3 CMS  TYPO3_7-6
TcaColumnsProcessRecordTitleTest.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 
19 
24 {
28  protected $subject;
29 
30  protected function setUp()
31  {
32  $this->subject = new TcaColumnsProcessRecordTitle();
33  }
34 
38  public function addDataRegistersLabelColumn()
39  {
40  $input = [
41  'columnsToProcess' => [],
42  'processedTca' => [
43  'ctrl' => [
44  'label' => 'uid'
45  ],
46  'columns' => [],
47  ]
48  ];
49 
50  $expected = $input;
51  $expected['columnsToProcess'] = ['uid'];
52  $this->assertSame($expected, $this->subject->addData($input));
53  }
54 
59  {
60  $input = [
61  'columnsToProcess' => [],
62  'processedTca' => [
63  'ctrl' => [
64  'label' => 'uid',
65  'label_alt' => 'aField,anotherField',
66  ],
67  'columns' => [],
68  ]
69  ];
70 
71  $expected = $input;
72  $expected['columnsToProcess'] = ['uid', 'aField', 'anotherField'];
73  $this->assertSame($expected, $this->subject->addData($input));
74  }
75 
80  {
81  $input = [
82  'columnsToProcess' => [],
83  'inlineParentConfig' => [
84  'foreign_label' => 'aForeignLabelField',
85  ],
86  'isInlineChild' => true,
87  ];
88 
89  $expected = $input;
90  $expected['columnsToProcess'] = [ 'aForeignLabelField' ];
91  $this->assertSame($expected, $this->subject->addData($input));
92  }
93 
98  {
99  $input = [
100  'columnsToProcess' => [],
101  'inlineParentConfig' => [
102  'symmetric_label' => 'aSymmetricLabelField',
103  ],
104  'isInlineChild' => true,
105  ];
106 
107  $expected = $input;
108  $expected['columnsToProcess'] = [ 'aSymmetricLabelField' ];
109  $this->assertSame($expected, $this->subject->addData($input));
110  }
111 }