‪TYPO3CMS  10.4
SiteConfigurationOverridesTest.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\Functional\FunctionalTestCase;
22 
26 class ‪SiteConfigurationOverridesTest extends FunctionalTestCase
27 {
28 
30  protected ‪$subject;
31 
35  protected ‪$testExtensionsToLoad = [
36  'typo3/sysext/backend/Tests/Functional/Configuration/SiteConfiguration/Fixtures/Extensions/conf_overriding/a',
37  'typo3/sysext/backend/Tests/Functional/Configuration/SiteConfiguration/Fixtures/Extensions/conf_overriding/b',
38  ];
39 
43  protected function ‪setUp(): void
44  {
45  parent::setUp();
46 
47  $this->subject = (new ‪SiteTcaConfiguration())->getTca();
48  }
49 
53  public function ‪allOverridesLoaded(): void
54  {
55  $columnsConfiguration = $this->subject['site']['columns'];
56 
57  self::assertArrayHasKey('tx_a_a', $columnsConfiguration);
58  self::assertArrayHasKey('tx_b_a', $columnsConfiguration);
59  }
60 
64  public function ‪overrideOnlyLoadedOnce(): void
65  {
66  $showitemConfiguration = $this->subject['site']['types']['0']['showitem'];
67 
68  self::assertSame(1, mb_substr_count($showitemConfiguration, 'tx_a_a'));
69  self::assertSame(1, mb_substr_count($showitemConfiguration, 'tx_b_a'));
70  }
71 
75  public function ‪finderUsesCorrectOrder(): void
76  {
77  $columnsConfiguration = $this->subject['site']['columns'];
78 
79  self::assertSame('Awesome description by extension b', $columnsConfiguration['tx_a_a']['description']);
80  }
81 }
‪TYPO3\CMS\Backend\Configuration\SiteTcaConfiguration
Definition: SiteTcaConfiguration.php:33
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\$subject
‪array $subject
Definition: SiteConfigurationOverridesTest.php:29
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\finderUsesCorrectOrder
‪finderUsesCorrectOrder()
Definition: SiteConfigurationOverridesTest.php:73
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest
Definition: SiteConfigurationOverridesTest.php:27
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\setUp
‪setUp()
Definition: SiteConfigurationOverridesTest.php:41
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\$testExtensionsToLoad
‪string[] $testExtensionsToLoad
Definition: SiteConfigurationOverridesTest.php:33
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration
Definition: SiteConfigurationOverridesTest.php:18
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\overrideOnlyLoadedOnce
‪overrideOnlyLoadedOnce()
Definition: SiteConfigurationOverridesTest.php:62
‪TYPO3\CMS\Backend\Tests\Functional\Configuration\SiteConfiguration\SiteConfigurationOverridesTest\allOverridesLoaded
‪allOverridesLoaded()
Definition: SiteConfigurationOverridesTest.php:51