‪TYPO3CMS  ‪main
PageTsConfigMergedTest.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 
20 use PHPUnit\Framework\Attributes\Test;
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
24 final class ‪PageTsConfigMergedTest extends UnitTestCase
25 {
27 
28  protected function ‪setUp(): void
29  {
30  parent::setUp();
31  $this->subject = new ‪PageTsConfigMerged();
32  }
33 
34  #[Test]
36  {
37  $input = [
38  'tableName' => 'aTable',
39  '' => 'aType',
40  'pageTsConfig' => [
41  'aSetting' => 'aValue',
42  ],
43  ];
44  $expected = $input;
45  $expected['pageTsConfig'] = $input['pageTsConfig'];
46  self::assertSame($expected, $this->subject->addData($input));
47  }
48 
49  #[Test]
51  {
52  $input = [
53  'tableName' => 'aTable',
54  'recordTypeValue' => 'aType',
55  'pageTsConfig' => [
56  'TCEFORM.' => [
57  'aTable.' => [
58  'aField.' => [
59  'disabled' => 1,
60  ],
61  ],
62  ],
63  ],
64  ];
65  $expected = $input;
66  $expected['pageTsConfig'] = $input['pageTsConfig'];
67  self::assertSame($expected, $this->subject->addData($input));
68  }
69 
70  #[Test]
72  {
73  $input = [
74  'tableName' => 'aTable',
75  'recordTypeValue' => 'aType',
76  'pageTsConfig' => [
77  'TCEFORM.' => [
78  'aTable.' => [
79  'aField.' => [
80  'types.' => [
81  'aType.' => [
82  'disabled' => 1,
83  ],
84  ],
85  ],
86  ],
87  ],
88  ],
89  ];
90  $expected = $input;
91  $expected['pageTsConfig'] = [
92  'TCEFORM.' => [
93  'aTable.' => [
94  'aField.' => [
95  'disabled' => 1,
96  ],
97  ],
98  ],
99  ];
100  self::assertSame($expected, $this->subject->addData($input));
101  }
102 
103  #[Test]
105  {
106  $input = [
107  'tableName' => 'aTable',
108  'recordTypeValue' => 'aType',
109  'pageTsConfig' => [
110  'TCEFORM.' => [
111  'aTable.' => [
112  'aField.' => [
113  'disabled' => 0,
114  'types.' => [
115  'aType.' => [
116  'disabled' => 1,
117  ],
118  ],
119  ],
120  ],
121  ],
122  ],
123  ];
124  $expected = $input;
125  $expected['pageTsConfig'] = [
126  'TCEFORM.' => [
127  'aTable.' => [
128  'aField.' => [
129  'disabled' => 1,
130  ],
131  ],
132  ],
133  ];
134  self::assertSame($expected, $this->subject->addData($input));
135  }
136 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest
Definition: PageTsConfigMergedTest.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\$subject
‪PageTsConfigMerged $subject
Definition: PageTsConfigMergedTest.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataMergesTypeSpecificConfiguration
‪addDataMergesTypeSpecificConfiguration()
Definition: PageTsConfigMergedTest.php:71
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataKeepsTableSpecificConfigurationWithoutType
‪addDataKeepsTableSpecificConfigurationWithoutType()
Definition: PageTsConfigMergedTest.php:50
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataTypeSpecificConfigurationOverwritesMainConfiguration
‪addDataTypeSpecificConfigurationOverwritesMainConfiguration()
Definition: PageTsConfigMergedTest.php:104
‪TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfigMerged
Definition: PageTsConfigMerged.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\setUp
‪setUp()
Definition: PageTsConfigMergedTest.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataSetsMergedTsConfigToTsConfig
‪addDataSetsMergedTsConfigToTsConfig()
Definition: PageTsConfigMergedTest.php:35
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18