‪TYPO3CMS  11.5
UserTsConfigTest.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 Prophecy\PhpUnit\ProphecyTrait;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
28 class ‪UserTsConfigTest extends UnitTestCase
29 {
30  use ProphecyTrait;
31 
32  protected ‪UserTsConfig ‪$subject;
33 
34  protected function ‪setUp(): void
35  {
36  parent::setUp();
37  $this->subject = new ‪UserTsConfig();
38  }
39 
43  public function ‪addDataSetsUserTypoScriptInResult(): void
44  {
45  $expected = ['foo'];
46  $backendUserAuthenticationProphecy = $this->prophesize(BackendUserAuthentication::class);
47  $backendUserAuthenticationProphecy->getTSConfig()->willReturn($expected);
48  ‪$GLOBALS['BE_USER'] = $backendUserAuthenticationProphecy->reveal();
49  $result = $this->subject->addData([]);
50  self::assertEquals($expected, $result['userTsConfig']);
51  }
52 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\UserTsConfigTest
Definition: UserTsConfigTest.php:29
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\UserTsConfigTest\addDataSetsUserTypoScriptInResult
‪addDataSetsUserTypoScriptInResult()
Definition: UserTsConfigTest.php:42
‪TYPO3\CMS\Backend\Form\FormDataProvider\UserTsConfig
Definition: UserTsConfig.php:25
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\UserTsConfigTest\setUp
‪setUp()
Definition: UserTsConfigTest.php:33
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\UserTsConfigTest\$subject
‪UserTsConfig $subject
Definition: UserTsConfigTest.php:31
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18