‪TYPO3CMS  9.5
MultiSiteTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
22 
27 {
30 
31  const ‪TABLE_Page = 'pages';
32 
36  protected ‪$assertionDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/MultiSite/DataSet/';
37 
41  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/';
42 
43  protected function ‪setUp()
44  {
45  parent::setUp();
46 
47  $this->‪importScenarioDataSet('LiveDefaultMultiSitePages');
48  $this->‪importScenarioDataSet('LiveDefaultElements');
49 
50  $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']);
51  }
52 
57  public function ‪moveRootPageToDifferentPageTree()
58  {
59  // Warm up caches for the root line utility to identify side effects
60  GeneralUtility::makeInstance(SiteMatcher::class)->matchByPageId(self::VALUE_PageIdWebsite);
61  GeneralUtility::makeInstance(SiteMatcher::class)->matchByPageId(self::VALUE_PageIdSecondSite);
62 
63  // URL is now "/1" for the second site
64  $this->actionService->moveRecord(self::TABLE_Page, self::VALUE_PageIdSecondSite, self::VALUE_PageIdWebsite);
65  $this->‪assertAssertionDataSet('moveRootPageToDifferentPageTree');
66 
67  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdSecondSite)->getResponseSections();
68  $this->assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
69  ->setTable(self::TABLE_Page)->setField('title')->setValues('Second Root Page'));
70  }
71 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint
‪HasRecordConstraint getRequestSectionHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:174
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest\VALUE_PageIdSecondSite
‪const VALUE_PageIdSecondSite
Definition: MultiSiteTest.php:29
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest\moveRootPageToDifferentPageTree
‪moveRootPageToDifferentPageTree()
Definition: MultiSiteTest.php:55
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest\VALUE_PageIdWebsite
‪const VALUE_PageIdWebsite
Definition: MultiSiteTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest\TABLE_Page
‪const TABLE_Page
Definition: MultiSiteTest.php:31
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:33
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest
Definition: MultiSiteTest.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest\$assertionDataSetDirectory
‪string $assertionDataSetDirectory
Definition: MultiSiteTest.php:35
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\assertAssertionDataSet
‪assertAssertionDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:124
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular
Definition: AbstractActionTestCase.php:2
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest\setUp
‪setUp()
Definition: MultiSiteTest.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\MultiSiteTest\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: MultiSiteTest.php:39
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Routing\SiteMatcher
Definition: SiteMatcher.php:53
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:117