‪TYPO3CMS  11.5
TcaColumnsProcessPlaceholdersTest.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 ‪TcaColumnsProcessPlaceholdersTest extends UnitTestCase
27 {
29 
30  protected function ‪setUp(): void
31  {
32  parent::setUp();
33  $this->subject = new ‪TcaColumnsProcessPlaceholders();
34  }
35 
39  public function ‪addDataRegistersPlaceholderColumns(): void
40  {
41  $input = [
42  'columnsToProcess' => [],
43  'processedTca' => [
44  'columns' => [
45  'aField' => [
46  'config' => [
47  'type' => 'input',
48  'placeholder' => '__row|anotherField',
49  ],
50  ],
51  ],
52  ],
53  ];
54 
55  $expected = $input;
56  $expected['columnsToProcess'] = ['anotherField'];
57  self::assertSame($expected, $this->subject->addData($input));
58  }
59 
64  {
65  $input = [
66  'columnsToProcess' => [],
67  'processedTca' => [
68  'columns' => [
69  'aField' => [
70  'config' => [
71  'type' => 'input',
72  'placeholder' => '__row|uid_local|metadata|title',
73  ],
74  ],
75  ],
76  ],
77  ];
78 
79  $expected = $input;
80  $expected['columnsToProcess'] = ['uid_local'];
81  self::assertSame($expected, $this->subject->addData($input));
82  }
83 
88  {
89  $input = [
90  'columnsToProcess' => [],
91  'processedTca' => [
92  'columns' => [
93  'aField' => [
94  'config' => [
95  'type' => 'input',
96  'placeholder' => 'A simple placeholder',
97  ],
98  ],
99  ],
100  ],
101  ];
102 
103  $expected = $input;
104  self::assertSame($expected, $this->subject->addData($input));
105  }
106 }
‪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:27
‪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