‪TYPO3CMS  11.5
TcaColumnsRemoveUnusedTest.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 ‪TcaColumnsRemoveUnusedTest extends UnitTestCase
27 {
29 
30  protected function ‪setUp(): void
31  {
32  parent::setUp();
33  $this->subject = new ‪TcaColumnsRemoveUnused();
34  }
35 
39  public function ‪addDataKeepsColumnsToProcess(): void
40  {
41  $input = [
42  'columnsToProcess' => ['keepMe', 'keepMeToo'],
43  'processedTca' => [
44  'columns' => [
45  'keepMe' => [
46  'config' => [
47  'type' => 'input',
48  ],
49  ],
50  'keepMeToo' => [
51  'config' => [
52  'type' => 'input',
53  ],
54  ],
55  'aField' => [
56  'config' => [
57  'type' => 'input',
58  ],
59  ],
60  ],
61  ],
62  ];
63 
64  $expected = $input;
65  unset($expected['processedTca']['columns']['aField']);
66 
67  self::assertSame($expected, $this->subject->addData($input));
68  }
69 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsRemoveUnusedTest\$subject
‪TcaColumnsRemoveUnused $subject
Definition: TcaColumnsRemoveUnusedTest.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsRemoveUnusedTest\setUp
‪setUp()
Definition: TcaColumnsRemoveUnusedTest.php:30
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsRemoveUnusedTest\addDataKeepsColumnsToProcess
‪addDataKeepsColumnsToProcess()
Definition: TcaColumnsRemoveUnusedTest.php:39
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\TcaColumnsRemoveUnusedTest
Definition: TcaColumnsRemoveUnusedTest.php:27
‪TYPO3\CMS\Backend\Form\FormDataProvider\TcaColumnsRemoveUnused
Definition: TcaColumnsRemoveUnused.php:27
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18