‪TYPO3CMS  10.4
TcaColumnsProcessPlaceholdersTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪TcaColumnsProcessPlaceholdersTest extends UnitTestCase
25 {
29  protected ‪$subject;
30 
31  protected function ‪setUp(): void
32  {
33  parent::setUp();
34  $this->subject = new ‪TcaColumnsProcessPlaceholders();
35  }
36 
41  {
42  $input = [
43  'columnsToProcess' => [],
44  'processedTca' => [
45  'columns' => [
46  'aField' => [
47  'config' => [
48  'type' => 'input',
49  'placeholder' => '__row|anotherField'
50  ],
51  ],
52  ],
53  ]
54  ];
55 
56  $expected = $input;
57  $expected['columnsToProcess'] = ['anotherField'];
58  self::assertSame($expected, $this->subject->addData($input));
59  }
60 
65  {
66  $input = [
67  'columnsToProcess' => [],
68  'processedTca' => [
69  'columns' => [
70  'aField' => [
71  'config' => [
72  'type' => 'input',
73  'placeholder' => '__row|uid_local|metadata|title'
74  ],
75  ],
76  ],
77  ]
78  ];
79 
80  $expected = $input;
81  $expected['columnsToProcess'] = ['uid_local'];
82  self::assertSame($expected, $this->subject->addData($input));
83  }
84 
89  {
90  $input = [
91  'columnsToProcess' => [],
92  'processedTca' => [
93  'columns' => [
94  'aField' => [
95  'config' => [
96  'type' => 'input',
97  'placeholder' => 'A simple placeholder'
98  ],
99  ],
100  ],
101  ]
102  ];
103 
104  $expected = $input;
105  self::assertSame($expected, $this->subject->addData($input));
106  }
107 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\addDataRegistersAlternativeLabelColumn
‪addDataRegistersAlternativeLabelColumn()
Definition: TcaColumnsProcessPlaceholdersTest.php:87
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\addDataRegistersPlaceholderColumns
‪addDataRegistersPlaceholderColumns()
Definition: TcaColumnsProcessPlaceholdersTest.php:39
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest
Definition: TcaColumnsProcessPlaceholdersTest.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\$subject
‪TcaColumnsProcessPlaceholders $subject
Definition: TcaColumnsProcessPlaceholdersTest.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\addDataRegistersFirstPlaceholderColumn
‪addDataRegistersFirstPlaceholderColumn()
Definition: TcaColumnsProcessPlaceholdersTest.php:63
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsProcessPlaceholdersTest\setUp
‪setUp()
Definition: TcaColumnsProcessPlaceholdersTest.php:30
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsProcessPlaceholders
Definition: TcaColumnsProcessPlaceholders.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18