‪TYPO3CMS  10.4
UserTsConfigTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
21 
25 class ‪UserTsConfigTest extends UnitTestCase
26 {
30  protected ‪$subject;
31 
32  protected function ‪setUp(): void
33  {
34  parent::setUp();
35  $this->subject = new ‪UserTsConfig();
36  }
37 
41  public function ‪addDataSetsUserTypoScriptInResult()
42  {
43  $expected = ['foo'];
44  $backendUserAuthenticationProphecy = $this->prophesize(BackendUserAuthentication::class);
45  $backendUserAuthenticationProphecy->getTSConfig()->willReturn($expected);
46  ‪$GLOBALS['BE_USER'] = $backendUserAuthenticationProphecy->reveal();
47  $result = $this->subject->addData([]);
48  self::assertEquals($expected, $result['userTsConfig']);
49  }
50 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\UserTsConfigTest
Definition: UserTsConfigTest.php:26
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\UserTsConfigTest\addDataSetsUserTypoScriptInResult
‪addDataSetsUserTypoScriptInResult()
Definition: UserTsConfigTest.php:40
‪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:31
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\UserTsConfigTest\$subject
‪UserTsConfig $subject
Definition: UserTsConfigTest.php:29
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18