‪TYPO3CMS  9.5
SiteConfigurationOverridesTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
20 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
21 
25 class ‪SiteConfigurationOverridesTest extends FunctionalTestCase
26 {
27 
29  protected ‪$subject;
30 
34  protected ‪$testExtensionsToLoad = [
35  'typo3/sysext/backend/Tests/Functional/Configuration/SiteConfiguration/Fixtures/Extensions/conf_overriding/a',
36  'typo3/sysext/backend/Tests/Functional/Configuration/SiteConfiguration/Fixtures/Extensions/conf_overriding/b',
37  ];
38 
42  protected function ‪setUp(): void
43  {
44  parent::setUp();
45 
46  $this->subject = (new ‪SiteTcaConfiguration())->getTca();
47  }
48 
52  public function ‪allOverridesLoaded(): void
53  {
54  $columnsConfiguration = $this->subject['site']['columns'];
55 
56  $this->assertArrayHasKey('tx_a_a', $columnsConfiguration);
57  $this->assertArrayHasKey('tx_b_a', $columnsConfiguration);
58  }
59 
63  public function ‪overrideOnlyLoadedOnce(): void
64  {
65  $showitemConfiguration = $this->subject['site']['types']['0']['showitem'];
66 
67  $this->assertSame(1, mb_substr_count($showitemConfiguration, 'tx_a_a'));
68  $this->assertSame(1, mb_substr_count($showitemConfiguration, 'tx_b_a'));
69  }
70 
74  public function ‪finderUsesCorrectOrder(): void
75  {
76  $columnsConfiguration = $this->subject['site']['columns'];
77 
78  $this->assertSame('Awesome description by extension b', $columnsConfiguration['tx_a_a']['description']);
79  }
80 }
‪TYPO3\CMS\Backend\Configuration\SiteTcaConfiguration
Definition: SiteTcaConfiguration.php:32
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\$subject
‪array $subject
Definition: SiteConfigurationOverridesTest.php:28
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\finderUsesCorrectOrder
‪finderUsesCorrectOrder()
Definition: SiteConfigurationOverridesTest.php:72
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest
Definition: SiteConfigurationOverridesTest.php:26
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\setUp
‪setUp()
Definition: SiteConfigurationOverridesTest.php:40
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\$testExtensionsToLoad
‪string[] $testExtensionsToLoad
Definition: SiteConfigurationOverridesTest.php:32
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration
Definition: SiteConfigurationOverridesTest.php:4
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\overrideOnlyLoadedOnce
‪overrideOnlyLoadedOnce()
Definition: SiteConfigurationOverridesTest.php:61
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\allOverridesLoaded
‪allOverridesLoaded()
Definition: SiteConfigurationOverridesTest.php:50