‪TYPO3CMS  ‪main
PageTsConfigFactoryTest.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;
23 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
24 
25 final class ‪PageTsConfigFactoryTest extends FunctionalTestCase
26 {
27  protected array ‪$testExtensionsToLoad = [
28  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_typoscript_pagetsconfigfactory',
29  ];
30 
31  #[Test]
33  {
34  ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] = 'loadedFromGlobals = loadedFromGlobals';
35  $subject = $this->get(PageTsConfigFactory::class);
36  $pageTsConfig = $subject->create([], new ‪NullSite());
37  self::assertSame('loadedFromGlobals', $pageTsConfig->getPageTsConfigArray()['loadedFromGlobals']);
38  }
39 
40  #[Test]
42  {
43  ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] = '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:test_typoscript_pagetsconfigfactory/Configuration/TsConfig/tsconfig-includes.tsconfig">';
45  $subject = $this->get(PageTsConfigFactory::class);
46  $pageTsConfig = $subject->create([], new ‪NullSite());
47  self::assertSame('loadedFromTsconfigIncludesWithTsconfigSuffix', $pageTsConfig->getPageTsConfigArray()['loadedFromTsconfigIncludesWithTsconfigSuffix']);
48  }
49 }
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\PageTsConfigFactoryTest\pageTsConfigLoadsDefaultsFromGlobals
‪pageTsConfigLoadsDefaultsFromGlobals()
Definition: PageTsConfigFactoryTest.php:32
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\PageTsConfigFactoryTest
Definition: PageTsConfigFactoryTest.php:26
‪TYPO3\CMS\Core\Site\Entity\NullSite
Definition: NullSite.php:32
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript
Definition: PageTsConfigFactoryTest.php:18
‪TYPO3\CMS\Core\TypoScript\PageTsConfigFactory
Definition: PageTsConfigFactory.php:44
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\PageTsConfigFactoryTest\pageTsConfigLoadsSingleFileWithOldImportSyntaxFromGlobals
‪pageTsConfigLoadsSingleFileWithOldImportSyntaxFromGlobals()
Definition: PageTsConfigFactoryTest.php:41
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\PageTsConfigFactoryTest\$testExtensionsToLoad
‪array $testExtensionsToLoad
Definition: PageTsConfigFactoryTest.php:27