‪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 
27 final class ‪UserTsConfigFactoryTest extends FunctionalTestCase
28 {
29  protected array ‪$testExtensionsToLoad = [
30  'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_typoscript_usertsconfigfactory',
31  ];
32 
33  #[Test]
35  {
36  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
37  $backendUser = $this->setUpBackendUser(2);
38  $subject = $this->get(UserTsConfigFactory::class);
39  $userTsConfig = $subject->create($backendUser);
40  self::assertSame('loadedFromTestExtensionConfigurationUserTsConfig', $userTsConfig->getUserTsConfigArray()['loadedFromTestExtensionConfigurationUserTsConfig']);
41  }
42 
43  #[Test]
45  {
46  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
47  $backendUser = $this->setUpBackendUser(2);
48  $subject = $this->get(UserTsConfigFactory::class);
49  $userTsConfig = $subject->create($backendUser);
50  self::assertSame('loadedFromUser', $userTsConfig->getUserTsConfigArray()['loadedFromUser']);
51  }
52 
53  #[Test]
55  {
56  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
57  $backendUser = $this->setUpBackendUser(3);
58  $subject = $this->get(UserTsConfigFactory::class);
59  $userTsConfig = $subject->create($backendUser);
60  self::assertSame('loadedFromUserGroup', $userTsConfig->getUserTsConfigArray()['loadedFromUserGroup']);
61  }
62 
63  #[Test]
65  {
66  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
67  $backendUser = $this->setUpBackendUser(4);
68  $subject = $this->get(UserTsConfigFactory::class);
69  $userTsConfig = $subject->create($backendUser);
70  self::assertSame('loadedFromUserGroupOverride', $userTsConfig->getUserTsConfigArray()['loadedFromUserGroup']);
71  }
72 
73  #[Test]
75  {
76  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
77  $backendUser = $this->setUpBackendUser(7);
78  $subject = $this->get(UserTsConfigFactory::class);
79  $userTsConfig = $subject->create($backendUser);
80  self::assertSame('loadedFromTsconfigIncludesWithTsconfigSuffix', $userTsConfig->getUserTsConfigArray()['loadedFromTsconfigIncludesWithTsconfigSuffix']);
81  }
82 
83  #[Test]
85  {
86  $this->importCSVDataSet(__DIR__ . '/Fixtures/userTsConfigTestFixture.csv');
87  $backendUser = $this->setUpBackendUser(8);
88  $subject = $this->get(UserTsConfigFactory::class);
89  $userTsConfig = $subject->create($backendUser);
90  self::assertSame('loadedFromTsconfigIncludesWithTyposcriptSuffix', $userTsConfig->getUserTsConfigArray()['loadedFromTsconfigIncludesWithTyposcriptSuffix']);
91  }
92 }
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest
Definition: UserTsConfigFactoryTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsFromWildcardAtImportWithTsconfigSuffix
‪userTsConfigLoadsFromWildcardAtImportWithTsconfigSuffix()
Definition: UserTsConfigFactoryTest.php:74
‪TYPO3\CMS\Core\TypoScript\UserTsConfigFactory
Definition: UserTsConfigFactory.php:38
‪TYPO3\CMS\Core\Tests\Functional\TypoScript
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsDefaultFromBackendUserTsConfigField
‪userTsConfigLoadsDefaultFromBackendUserTsConfigField()
Definition: UserTsConfigFactoryTest.php:44
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsFromWildcardAtImportWithTypoScriptSuffix
‪userTsConfigLoadsFromWildcardAtImportWithTypoScriptSuffix()
Definition: UserTsConfigFactoryTest.php:84
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsDefaultFromExtensionConfigurationUserTsconfig
‪userTsConfigLoadsDefaultFromExtensionConfigurationUserTsconfig()
Definition: UserTsConfigFactoryTest.php:34
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsDefaultFromBackendUserGroupTsConfigFieldAndGroupOverride
‪userTsConfigLoadsDefaultFromBackendUserGroupTsConfigFieldAndGroupOverride()
Definition: UserTsConfigFactoryTest.php:64
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest\$testExtensionsToLoad
‪array $testExtensionsToLoad
Definition: UserTsConfigFactoryTest.php:29
‪TYPO3\CMS\Core\Tests\Functional\TypoScript\UserTsConfigFactoryTest\userTsConfigLoadsDefaultFromBackendUserGroupTsConfigField
‪userTsConfigLoadsDefaultFromBackendUserGroupTsConfigField()
Definition: UserTsConfigFactoryTest.php:54