‪TYPO3CMS  ‪main
UserTsConfigFactoryTest.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\Functional\FunctionalTestCase;
23 
24 final class ‪UserTsConfigFactoryTest extends FunctionalTestCase
25 {
26  protected array ‪$testExtensionsToLoad = [
27  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_typoscript_usertsconfigfactory',
28  ];
29 
30  #[Test]
32  {
33  ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] = 'loadedFromGlobals = loadedFromGlobals';
34  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
35  $backendUser = $this->setUpBackendUser(1);
36  $subject = $this->get(UserTsConfigFactory::class);
37  $userTsConfig = $subject->create($backendUser);
38  self::assertSame('loadedFromGlobals', $userTsConfig->getUserTsConfigArray()['loadedFromGlobals']);
39  }
40 
41  #[Test]
43  {
44  ‪$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] = '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:test_typoscript_usertsconfigfactory/Configuration/TsConfig/tsconfig-includes.tsconfig">';
45  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
46  $backendUser = $this->setUpBackendUser(1);
48  $subject = $this->get(UserTsConfigFactory::class);
49  $userTsConfig = $subject->create($backendUser);
50  self::assertSame('loadedFromTsconfigIncludesWithTsconfigSuffix', $userTsConfig->getUserTsConfigArray()['loadedFromTsconfigIncludesWithTsconfigSuffix']);
51  }
52 }
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\UserTsConfigFactoryTest
Definition: UserTsConfigFactoryTest.php:25
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript
Definition: PageTsConfigFactoryTest.php:18
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsSingleFileWithOldImportSyntaxFromGlobals
‪userTsConfigLoadsSingleFileWithOldImportSyntaxFromGlobals()
Definition: UserTsConfigFactoryTest.php:42
‪TYPO3\CMS\Core\TypoScript\UserTsConfigFactory
Definition: UserTsConfigFactory.php:38
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsDefaultFromGlobals
‪userTsConfigLoadsDefaultFromGlobals()
Definition: UserTsConfigFactoryTest.php:31
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Tests\FunctionalDeprecated\TypoScript\UserTsConfigFactoryTest\$testExtensionsToLoad
‪array $testExtensionsToLoad
Definition: UserTsConfigFactoryTest.php:26