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