‪TYPO3CMS  9.5
TcaColumnsProcessPlaceholdersTest.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 ‪TcaColumnsProcessPlaceholdersTest extends UnitTestCase
24 {
28  protected ‪$subject;
29 
30  protected function ‪setUp()
31  {
32  $this->subject = new ‪TcaColumnsProcessPlaceholders();
33  }
34 
39  {
40  $input = [
41  'columnsToProcess' => [],
42  'processedTca' => [
43  'columns' => [
44  'aField' => [
45  'config' => [
46  'type' => 'input',
47  'placeholder' => '__row|anotherField'
48  ],
49  ],
50  ],
51  ]
52  ];
53 
54  $expected = $input;
55  $expected['columnsToProcess'] = ['anotherField'];
56  $this->assertSame($expected, $this->subject->addData($input));
57  }
58 
63  {
64  $input = [
65  'columnsToProcess' => [],
66  'processedTca' => [
67  'columns' => [
68  'aField' => [
69  'config' => [
70  'type' => 'input',
71  'placeholder' => '__row|uid_local|metadata|title'
72  ],
73  ],
74  ],
75  ]
76  ];
77 
78  $expected = $input;
79  $expected['columnsToProcess'] = ['uid_local'];
80  $this->assertSame($expected, $this->subject->addData($input));
81  }
82 
87  {
88  $input = [
89  'columnsToProcess' => [],
90  'processedTca' => [
91  'columns' => [
92  'aField' => [
93  'config' => [
94  'type' => 'input',
95  'placeholder' => 'A simple placeholder'
96  ],
97  ],
98  ],
99  ]
100  ];
101 
102  $expected = $input;
103  $this->assertSame($expected, $this->subject->addData($input));
104  }
105 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\addDataRegistersAlternativeLabelColumnn
‪addDataRegistersAlternativeLabelColumnn()
Definition: TcaColumnsProcessPlaceholdersTest.php:85
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\addDataRegistersPlaceholderColumns
‪addDataRegistersPlaceholderColumns()
Definition: TcaColumnsProcessPlaceholdersTest.php:37
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest
Definition: TcaColumnsProcessPlaceholdersTest.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\$subject
‪TcaColumnsProcessPlaceholders $subject
Definition: TcaColumnsProcessPlaceholdersTest.php:27
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\addDataRegistersFirstPlaceholderColumn
‪addDataRegistersFirstPlaceholderColumn()
Definition: TcaColumnsProcessPlaceholdersTest.php:61
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\setUp
‪setUp()
Definition: TcaColumnsProcessPlaceholdersTest.php:29
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessPlaceholders
Definition: TcaColumnsProcessPlaceholders.php:24
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:3