‪TYPO3CMS  10.4
BackendUtilityTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
9 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
10 
11 class ‪BackendUtilityTest extends FunctionalTestCase
12 {
13  public function ‪setUp(): void
14  {
15  parent::setUp();
16  $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/pages.xml');
17  $this->setUpBackendUserFromFixture(1);
18  }
19 
23  public function ‪givenPageIdCanBeExpanded(): void
24  {
25  $backendUser = $this->‪getBackendUser();
26  $backendUser->groupData['webmounts'] = '1';
27 
29 
30  $expectedSiteHash = [
31  '1_5' => '1',
32  '1_1' => '1',
33  '1_0' => '1'
34  ];
35  $actualSiteHash = $backendUser->uc['BackendComponents']['States']['Pagetree']['stateHash'];
36  self::assertSame($expectedSiteHash, $actualSiteHash);
37  }
38 
43  {
44  $backendUser = $this->‪getBackendUser();
45  $backendUser->groupData['webmounts'] = '1';
46 
49 
50  //the complete branch of uid => 5 should be closed here
51  $expectedSiteHash = [
52  '1_4' => '1',
53  '1_3' => '1',
54  '1_2' => '1',
55  '1_1' => '1',
56  '1_0' => '1'
57  ];
58  $actualSiteHash = $backendUser->uc['BackendComponents']['States']['Pagetree']['stateHash'];
59  self::assertSame($expectedSiteHash, $actualSiteHash);
60  }
61 
63  {
64  return ‪$GLOBALS['BE_USER'];
65  }
66 }
‪TYPO3\CMS\Backend\Tests\Functional\Utility\BackendUtilityTest\givenPageIdCanBeExpanded
‪givenPageIdCanBeExpanded()
Definition: BackendUtilityTest.php:23
‪TYPO3\CMS\Backend\Tests\Functional\Utility\BackendUtilityTest\otherBranchesCanBeClosedWhenOpeningPage
‪otherBranchesCanBeClosedWhenOpeningPage()
Definition: BackendUtilityTest.php:42
‪TYPO3\CMS\Backend\Tests\Functional\Utility\BackendUtilityTest
Definition: BackendUtilityTest.php:12
‪TYPO3\CMS\Backend\Tests\Functional\Utility\BackendUtilityTest\getBackendUser
‪getBackendUser()
Definition: BackendUtilityTest.php:62
‪TYPO3\CMS\Backend\Tests\Functional\Utility\BackendUtilityTest\setUp
‪setUp()
Definition: BackendUtilityTest.php:13
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Backend\Tests\Functional\Utility
Definition: BackendUtilityTest.php:5
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Backend\Utility\BackendUtility\openPageTree
‪static openPageTree($pid, $clearExpansion)
Definition: BackendUtility.php:505