[TASK] Streamline site handling functional tests 55/57955/4
authorOliver Hader <oliver@typo3.org>
Sat, 18 Aug 2018 11:48:24 +0000 (13:48 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 18 Aug 2018 17:46:59 +0000 (19:46 +0200)
Some additional tests are added and the scenario
is extended with pagetrees without a site (sys_domain
in use).

Resolves: #85897
Releases: master
Change-Id: I5c6f61c59e9383de2199dbbc687fdd0924cde1af
Reviewed-on: https://review.typo3.org/57955
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/frontend/Tests/Functional/SiteHandling/AbstractRequestTest.php
typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/scenario.yaml
typo3/sysext/frontend/Tests/Functional/SiteHandling/PlainRequestTest.php
typo3/sysext/frontend/Tests/Functional/SiteHandling/SiteRequestTest.php

index e2fb5aa..1d86ccb 100644 (file)
@@ -15,6 +15,10 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\SiteHandling;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Configuration\SiteConfiguration;
+use TYPO3\CMS\Core\Utility\ArrayUtility;
+use TYPO3\CMS\Frontend\Page\CacheHashCalculator;
+use TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Fixtures\PhpError;
 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
 
 /**
@@ -35,6 +39,12 @@ abstract class AbstractRequestTest extends FunctionalTestCase
         ]
     ];
 
+    protected const LANGUAGE_PRESETS = [
+        'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8', 'iso' => 'en', 'hrefLang' => 'en-US', 'direction' => ''],
+        'FR' => ['id' => 1, 'title' => 'French', 'locale' => 'fr_FR.UTF8', 'iso' => 'fr', 'hrefLang' => 'fr-FR', 'direction' => ''],
+        'FR-CA' => ['id' => 2, 'title' => 'Franco-Canadian', 'locale' => 'fr_CA.UTF8', 'iso' => 'fr', 'hrefLang' => 'fr-CA', 'direction' => ''],
+    ];
+
     /**
      * @var array
      */
@@ -110,4 +120,193 @@ abstract class AbstractRequestTest extends FunctionalTestCase
             . '* ' . implode(LF . '* ', $items)
         );
     }
+
+    /**
+     * @param string $identifier
+     * @param array $site
+     * @param array $languages
+     * @param array $errorHandling
+     */
+    protected function writeSiteConfiguration(
+        string $identifier,
+        array $site = [],
+        array $languages = [],
+        array $errorHandling = []
+    ) {
+        $configuration = [
+            'site' => $site,
+        ];
+        if (!empty($languages)) {
+            $configuration['site']['languages'] = $languages;
+        }
+        if (!empty($errorHandling)) {
+            $configuration['site']['errorHandling'] = $errorHandling;
+        }
+
+        $siteConfiguration = new SiteConfiguration(
+            $this->instancePath . '/typo3conf/sites/'
+        );
+
+        try {
+            $siteConfiguration->write($identifier, $configuration);
+        } catch (\Exception $exception) {
+            $this->markTestSkipped($exception->getMessage());
+        }
+    }
+
+    /**
+     * @param int $rootPageId
+     * @param string $base
+     * @return array
+     */
+    protected function buildSiteConfiguration(
+        int $rootPageId,
+        string $base = ''
+    ): array {
+        return [
+            'rootPageId' => $rootPageId,
+            'base' => $base,
+        ];
+    }
+
+    /**
+     * @param string $identifier
+     * @param string $base
+     * @return array
+     */
+    protected function buildDefaultLanguageConfiguration(
+        string $identifier,
+        string $base
+    ): array {
+        $configuration = $this->buildLanguageConfiguration($identifier, $base);
+        $configuration['typo3Language'] = 'default';
+        $configuration['flag'] = 'global';
+        unset($configuration['fallbackType']);
+        return $configuration;
+    }
+
+    /**
+     * @param string $identifier
+     * @param string $base
+     * @param array $fallbackIdentifiers
+     * @return array
+     */
+    protected function buildLanguageConfiguration(
+        string $identifier,
+        string $base,
+        array $fallbackIdentifiers = []
+    ): array {
+        $preset = $this->resolveLanguagePreset($identifier);
+
+        $configuration = [
+            'languageId' => $preset['id'],
+            'title' => $preset['title'],
+            'navigationTitle' => $preset['title'],
+            'base' => $base,
+            'locale' => $preset['locale'],
+            'iso-639-1' => $preset['iso'],
+            'hreflang' => $preset['hrefLang'],
+            'direction' => $preset['direction'],
+            'typo3Language' => $preset['iso'],
+            'flag' => $preset['iso'],
+            'fallbackType' => 'strict',
+        ];
+
+        if (!empty($fallbackIdentifiers)) {
+            $fallbackIds = array_map(
+                function (string $fallbackIdentifier) {
+                    $preset = $this->resolveLanguagePreset($fallbackIdentifier);
+                    return $preset['id'];
+                },
+                $fallbackIdentifiers
+            );
+            $configuration['fallbackType'] = 'fallback';
+            $configuration['fallbackType'] = implode(',', $fallbackIds);
+        }
+
+        return $configuration;
+    }
+
+    /**
+     * @param string $handler
+     * @param array $codes
+     * @return array
+     */
+    protected function buildErrorHandlingConfiguration(
+        string $handler,
+        array $codes
+    ): array {
+        if ($handler === 'Page') {
+            $baseConfiguration = [
+                'errorContentSource' => '404',
+            ];
+        } elseif ($handler === 'Fluid') {
+            $baseConfiguration = [
+                'errorFluidTemplate' => 'typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/FluidError.html',
+                'errorFluidTemplatesRootPath' => '',
+                'errorFluidLayoutsRootPath' => '',
+                'errorFluidPartialsRootPath' => '',
+            ];
+        } elseif ($handler === 'PHP') {
+            $baseConfiguration = [
+                'errorPhpClassFQCN' => PhpError::class,
+            ];
+        } else {
+            throw new \LogicException(
+                sprintf('Invalid handler "%s"', $handler),
+                1533894782
+            );
+        }
+
+        $baseConfiguration['errorHandler'] = $handler;
+
+        return array_map(
+            function (int $code) use ($baseConfiguration) {
+                $baseConfiguration['errorCode'] = $code;
+                return $baseConfiguration;
+            },
+            $codes
+        );
+    }
+
+    /**
+     * @param string $identifier
+     * @return mixed
+     */
+    protected function resolveLanguagePreset(string $identifier)
+    {
+        if (!isset(static::LANGUAGE_PRESETS[$identifier])) {
+            throw new \LogicException(
+                sprintf('Undefined preset identifier "%s"', $identifier),
+                1533893665
+            );
+        }
+        return static::LANGUAGE_PRESETS[$identifier];
+    }
+
+    /**
+     * @param string $uri
+     * @return string
+     */
+    protected static function generateCacheHash(string $uri): string
+    {
+        if (!isset($GLOBALS['TYPO3_CONF_VARS'])) {
+            $GLOBALS['TYPO3_CONF_VARS'] = [];
+        }
+
+        $configuration = $GLOBALS['TYPO3_CONF_VARS'];
+        ArrayUtility::mergeRecursiveWithOverrule(
+            $GLOBALS['TYPO3_CONF_VARS'],
+            static::TYPO3_CONF_VARS
+        );
+
+        $calculator = new CacheHashCalculator();
+        $parameters = $calculator->getRelevantParameters(
+            parse_url($uri, PHP_URL_QUERY)
+        );
+        $cacheHash = $calculator->calculateCacheHash($parameters);
+
+        $GLOBALS['TYPO3_CONF_VARS'] = $configuration;
+        return $cacheHash;
+    }
 }
index 2746eea..b26f63f 100644 (file)
@@ -1,9 +1,11 @@
 __variables:
   - &pageStandard 0
   - &pageShortcut 4
+  - &pageMount 7
+  - &pageFolder 254
   - &contentText 'text'
-  - &idAcmeRootPage 101
-  - &idAcmeFirstPage 102
+  - &idAcmeRootPage 1000
+  - &idAcmeFirstPage 1100
 
 entitySettings:
   '*':
@@ -15,7 +17,7 @@ entitySettings:
     tableName: 'pages'
     parentColumnName: 'pid'
     languageColumnNames: ['l10n_parent', 'l10n_source']
-    columnNames: {type: 'doktype', root: 'is_siteroot'}
+    columnNames: {type: 'doktype', root: 'is_siteroot', mount: 'mount_pid', visitorGroups: 'fe_group'}
     defaultValues: {hidden: 0, doktype: *pageStandard}
     valueInstructions:
       shortcut:
@@ -24,9 +26,16 @@ entitySettings:
     tableName: 'tt_content'
     languageColumnNames: ['l18n_parent', 'l10n_source']
     columnNames: {title: 'header', type: 'CType'}
+  domain:
+    tableName: 'sys_domain'
   language:
     tableName: 'sys_language'
     columnNames: {code: 'language_isocode'}
+  visitorGroup:
+    tableName: 'fe_groups'
+  visitor:
+    tableName: 'fe_users'
+    columnNames: {groups: 'usergroup'}
   typoscript:
     tableName: 'sys_template'
     valueInstructions:
@@ -39,25 +48,11 @@ entities:
     - self: {id: 2, title: 'Franco-Canadian', code: 'fr'}
   page:
     - self: {id: *idAcmeRootPage, title: 'ACME Inc', type: *pageShortcut, shortcut: 'first', root: true, alias: 'acme-root'}
-      entities:
-        # @todo Fallback TypoScript, probably remove
-        typoscript:
-          - self:
-              type: site
-              title: 'ACME Inc'
-              sitetitle: 'A Company that Manufactures Everything Inc'
-              config: |
-                page = PAGE
-                page {
-                  10 = TEXT
-                  10.data = page:uid
-                }
-
       children:
         - self: {id: *idAcmeFirstPage, title: 'EN: Welcome', alias: 'acme-first'}
           languageVariants:
-            - self: {title: 'FR: Welcome', language: 1}
-            - self: {title: 'FR-CA: Welcome', language: 2}
+            - self: {id: 1101, title: 'FR: Welcome', language: 1}
+            - self: {id: 1102, title: 'FR-CA: Welcome', language: 2}
           entities:
             content:
               - self: {title: 'EN: Content Element #1', type: *contentText}
@@ -67,11 +62,69 @@ entities:
                     languageVariants:
                       - self: {title: 'FR-CA: Content Element #1', type: *contentText, language: 2}
               - self: {title: 'EN: Content Element #2', type: *contentText}
+        - self: {id: 1200, title: 'EN: Features'}
+          children:
+            - self: {id: 1121, title: 'EN: Frontend Editing'}
+        - self: {id: 1300, title: 'EN: Products', root: true}
+          children:
+            - self: {id: 1310, title: 'EN: Planets'}
+            - self: {id: 1320, title: 'EN: Spaceships'}
+            - self: {id: 1330, title: 'EN: Dark Matter'}
+        - self: {id: 1500, title: 'Internal'}
           children:
-            - self: {title: 'EN: Home', type: *pageShortcut, shortcut: *idAcmeRootPage}
-            - self: {title: 'EN: Features'}
-            - self: {title: 'EN: Contact'}
+            - self: {id: 1510, title: 'Whitepapers', visitorGroups: -2, extendToSubpages: true}
+              children:
+                - self: {id: 1511, title: 'Products'}
+                - self: {id: 1512, title: 'Solutions'}
+                - self: {id: 1515, title: 'Research', visitorGroups: 20}
+            - self: {id: 1520, title: 'Forecasts', visitorGroups: 20, extendToSubpages: true}
+              children:
+                - self: {id: 1521, title: 'Current Year'}
+                - self: {id: 1522, title: 'Next Year'}
+                - self: {id: 1523, title: 'Five Years'}
+        - self: {id: 1600, title: 'About us'}
+        - self: {id: 1700, title: 'Announcements & News', type: *pageMount, mount: 7100}
         - self: {id: 404, title: 'Page not found'}
           entities:
             content:
               - self: {title: 'EN: Page not found', type: *contentText}
+        - self: {id: 1990, title: 'Storage', type: *pageFolder}
+          entities:
+            visitorGroup:
+              - self: {id: 10, title: 'Customers'}
+              - self: {id: 20, title: 'Partners'}
+            visitor:
+              - self: {id: 1, username: 'john@doe.local', groups: '10'}
+              - self: {id: 2, username: 'manager@other-inc.local', groups: '20'}
+              - self: {id: 3, username: 'big-boss@acme-inc.local', groups: '10,20'}
+    - self: {id: 2000, title: 'ACME Blog', type: *pageShortcut, shortcut: 'first', root: true, alias: 'blog-root'}
+      children:
+        - self: {id: 2100, title: 'Authors'}
+          children:
+            - self: {id: 2110, title: 'John Doe'}
+              children:
+                - self: {id: 2111, title: 'About'}
+            - self: {id: 2120, title: 'Jane Doe'}
+              children:
+                - self: {id: 2121, title: 'About'}
+        - self: {id: 2700, title: 'Announcements & News', type: *pageMount, mount: 7100}
+    - self: {id: 3000, title: 'ACME Archive', type: *pageShortcut, shortcut: 'first', root: true}
+      children:
+        - self: {id: 3100, title: 'EN: Statistics'}
+          languageVariants:
+            - self: {id: 3101, title: 'FR: Statistics', language: 1}
+            - self: {id: 3102, title: 'FR-CA: Statistics', language: 2}
+          children:
+            - self: {id: 3110, title: 'EN: Markets'}
+            - self: {id: 3120, title: 'EN: Products'}
+            - self: {id: 3130, title: 'EN: Partners'}
+      entities:
+        domain:
+          - self: {domainName: 'archive.acme.com'}
+    - self: {id: 7000, title: 'Common Collection', type: *pageFolder}
+      children:
+        - self: {id: 7100, title: 'Announcements & News'}
+          children:
+            - self: {id: 7110, title: 'Markets'}
+            - self: {id: 7120, title: 'Products'}
+            - self: {id: 7130, title: 'Partners'}
index 03b7547..2c09120 100644 (file)
@@ -67,7 +67,7 @@ class PlainRequestTest extends AbstractRequestTest
         );
 
         $this->setUpFrontendRootPage(
-            101,
+            1000,
             [
                 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
                 'typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/JsonRenderer.typoscript',
@@ -77,6 +77,17 @@ class PlainRequestTest extends AbstractRequestTest
                 'sitetitle' => $this->siteTitle,
             ]
         );
+        $this->setUpFrontendRootPage(
+            3000,
+            [
+                'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
+                'typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/JsonRenderer.typoscript',
+            ],
+            [
+                'title' => 'ACME Archive',
+                'sitetitle' => $this->siteTitle,
+            ]
+        );
     }
 
     protected function tearDown()
@@ -103,7 +114,7 @@ class PlainRequestTest extends AbstractRequestTest
 
         $queries = [
             '?',
-            '?id=101',
+            '?id=1000',
             '?id=acme-root'
         ];
 
@@ -147,7 +158,7 @@ class PlainRequestTest extends AbstractRequestTest
         ];
 
         $queries = [
-            '?id=102',
+            '?id=1100',
             '?id=acme-first',
         ];
 
@@ -209,6 +220,56 @@ class PlainRequestTest extends AbstractRequestTest
     /**
      * @return array
      */
+    public function pageIsRenderedWithDomainsDataProvider(): array
+    {
+        $uris = [
+            'https://archive.acme.com/?id=3100' => 'EN: Statistics',
+            'https://archive.acme.com/?id=3110' => 'EN: Markets',
+            'https://archive.acme.com/?id=3120' => 'EN: Products',
+            'https://archive.acme.com/?id=3130' => 'EN: Partners',
+        ];
+
+        $data = [];
+        foreach ($uris as $uri => $expectation) {
+            $data[$uri] = [$uri, $expectation];
+        }
+        return $data;
+    }
+
+    /**
+     * @param string $uri
+     * @param string $expectedPageTitle
+     *
+     * @test
+     * @dataProvider pageIsRenderedWithDomainsDataProvider
+     */
+    public function pageIsRenderedWithDomains(string $uri, string $expectedPageTitle)
+    {
+        $response = $this->executeFrontendRequest(
+            new InternalRequest($uri),
+            $this->internalRequestContext
+        );
+        $responseStructure = ResponseContent::fromString(
+            (string)$response->getBody()
+        );
+
+        static::assertSame(
+            200,
+            $response->getStatusCode()
+        );
+        static::assertSame(
+            $this->siteTitle,
+            $responseStructure->getScopePath('template/sitetitle')
+        );
+        static::assertSame(
+            $expectedPageTitle,
+            $responseStructure->getScopePath('page/title')
+        );
+    }
+
+    /**
+     * @return array
+     */
     public function pageRenderingStopsWithInvalidCacheHashDataProvider(): array
     {
         $domainPaths = [
@@ -221,9 +282,9 @@ class PlainRequestTest extends AbstractRequestTest
 
         $queries = [
             '?',
-            '?id=101',
+            '?id=1000',
             '?id=acme-root',
-            '?id=102',
+            '?id=1100',
             '?id=acme-first',
         ];
 
@@ -306,11 +367,11 @@ class PlainRequestTest extends AbstractRequestTest
         // cHash has been calculated with encryption key set to
         // '4408d27a916d51e624b69af3554f516dbab61037a9f7b9fd6f81b4d3bedeccb6'
         $queries = [
-            // @todo Currently fails since cHash is verified after(!) redirect to page 102
-            // '?&cHash=814ea11ad629c7e24cfd031cea2779f4&id=101',
-            // '?&cHash=814ea11ad629c7e24cfd031cea2779f4id=acme-root',
-            '?&cHash=126d2980c12f4759fed1bb7429db2dff&id=102',
-            '?&cHash=126d2980c12f4759fed1bb7429db2dff&id=acme-first',
+            // @todo Currently fails since cHash is verified after(!) redirect to page 1100
+            // '?&cHash=7d1f13fa91159dac7feb3c824936b39d&id=1000',
+            // '?&cHash=7d1f13fa91159dac7feb3c824936b39d=acme-root',
+            '?&cHash=f42b850e435f0cedd366f5db749fc1af&id=1100',
+            '?&cHash=f42b850e435f0cedd366f5db749fc1af&id=acme-first',
         ];
 
         $customQueries = [
index 05f7ca1..cfe86a8 100644 (file)
@@ -15,10 +15,8 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\SiteHandling;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Configuration\SiteConfiguration;
 use TYPO3\CMS\Core\Core\Bootstrap;
 use TYPO3\CMS\Core\Error\Http\PageNotFoundException;
-use TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Fixtures\PhpError;
 use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService;
 use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\Scenario\DataMapFactory;
 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
@@ -30,12 +28,6 @@ use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
  */
 class SiteRequestTest extends AbstractRequestTest
 {
-    protected const LANGUAGE_PRESETS = [
-        'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8', 'iso' => 'en', 'hrefLang' => 'en-US', 'direction' => ''],
-        'FR' => ['id' => 1, 'title' => 'French', 'locale' => 'fr_FR.UTF8', 'iso' => 'fr', 'hrefLang' => 'fr-FR', 'direction' => ''],
-        'FR-CA' => ['id' => 2, 'title' => 'Franco-Canadian', 'locale' => 'fr_CA.UTF8', 'iso' => 'fr', 'hrefLang' => 'fr-CA', 'direction' => ''],
-    ];
-
     /**
      * @var string
      */
@@ -75,7 +67,7 @@ class SiteRequestTest extends AbstractRequestTest
         );
 
         $this->setUpFrontendRootPage(
-            101,
+            1000,
             [
                 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
                 'typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/JsonRenderer.typoscript',
@@ -109,7 +101,7 @@ class SiteRequestTest extends AbstractRequestTest
 
         $queries = [
             '?',
-            '?id=101',
+            '?id=1000',
             '?id=acme-root'
         ];
 
@@ -130,7 +122,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/')
+            $this->buildSiteConfiguration(1000, 'https://website.local/')
         );
 
         $expectedStatusCode = 307;
@@ -163,7 +155,7 @@ class SiteRequestTest extends AbstractRequestTest
         ];
 
         $queries = [
-            '?id=102',
+            '?id=1100',
             '?id=acme-first',
         ];
 
@@ -195,7 +187,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/'),
+            $this->buildSiteConfiguration(1000, 'https://website.local/'),
             [
                 $this->buildDefaultLanguageConfiguration('EN', '/en-en/'),
                 $this->buildLanguageConfiguration('FR', '/fr-fr/', ['EN']),
@@ -239,7 +231,7 @@ class SiteRequestTest extends AbstractRequestTest
         ];
 
         $queries = [
-            '?id=102',
+            '?id=1100',
             '?id=acme-first',
         ];
 
@@ -271,7 +263,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/'),
+            $this->buildSiteConfiguration(1000, 'https://website.local/'),
             [
                 $this->buildDefaultLanguageConfiguration('EN', 'https://website.us/'),
                 $this->buildLanguageConfiguration('FR', 'https://website.fr/', ['EN']),
@@ -312,9 +304,9 @@ class SiteRequestTest extends AbstractRequestTest
 
         $queries = [
             '?',
-            '?id=101',
+            '?id=1000',
             '?id=acme-root',
-            '?id=102',
+            '?id=1100',
             '?id=acme-first',
         ];
 
@@ -341,7 +333,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/')
+            $this->buildSiteConfiguration(1000, 'https://website.local/')
         );
 
         $this->expectExceptionCode(1518472189);
@@ -395,7 +387,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/'),
+            $this->buildSiteConfiguration(1000, 'https://website.local/'),
             [],
             $this->buildErrorHandlingConfiguration('Fluid', [404])
         );
@@ -429,7 +421,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/'),
+            $this->buildSiteConfiguration(1000, 'https://website.local/'),
             [],
             $this->buildErrorHandlingConfiguration('Page', [404])
         );
@@ -455,7 +447,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/'),
+            $this->buildSiteConfiguration(1000, 'https://website.local/'),
             [],
             $this->buildErrorHandlingConfiguration('PHP', [404])
         );
@@ -493,11 +485,11 @@ class SiteRequestTest extends AbstractRequestTest
         // cHash has been calculated with encryption key set to
         // '4408d27a916d51e624b69af3554f516dbab61037a9f7b9fd6f81b4d3bedeccb6'
         $queries = [
-            // @todo Currently fails since cHash is verified after(!) redirect to page 102
-            // '?&cHash=814ea11ad629c7e24cfd031cea2779f4&id=101',
-            // '?&cHash=814ea11ad629c7e24cfd031cea2779f4id=acme-root',
-            '?&cHash=126d2980c12f4759fed1bb7429db2dff&id=102',
-            '?&cHash=126d2980c12f4759fed1bb7429db2dff&id=acme-first',
+            // @todo Currently fails since cHash is verified after(!) redirect to page 1100
+            // '?&cHash=7d1f13fa91159dac7feb3c824936b39d&id=1000',
+            // '?&cHash=7d1f13fa91159dac7feb3c824936b39d=acme-root',
+            '?&cHash=f42b850e435f0cedd366f5db749fc1af&id=1100',
+            '?&cHash=f42b850e435f0cedd366f5db749fc1af&id=acme-first',
         ];
 
         $customQueries = [
@@ -523,7 +515,7 @@ class SiteRequestTest extends AbstractRequestTest
     {
         $this->writeSiteConfiguration(
             'website-local',
-            $this->buildSiteConfiguration(101, 'https://website.local/')
+            $this->buildSiteConfiguration(1000, 'https://website.local/')
         );
 
         $response = $this->executeFrontendRequest(
@@ -538,167 +530,4 @@ class SiteRequestTest extends AbstractRequestTest
             $responseStructure->getScopePath('getpost/testing.value')
         );
     }
-
-    /**
-     * @param string $identifier
-     * @param array $site
-     * @param array $languages
-     * @param array $errorHandling
-     */
-    private function writeSiteConfiguration(
-        string $identifier,
-        array $site = [],
-        array $languages = [],
-        array $errorHandling = []
-    ) {
-        $configuration = [
-            'site' => $site,
-        ];
-        if (!empty($languages)) {
-            $configuration['site']['languages'] = $languages;
-        }
-        if (!empty($errorHandling)) {
-            $configuration['site']['errorHandling'] = $errorHandling;
-        }
-
-        $siteConfiguration = new SiteConfiguration(
-            $this->instancePath . '/typo3conf/sites/'
-        );
-
-        try {
-            $siteConfiguration->write($identifier, $configuration);
-        } catch (\Exception $exception) {
-            $this->markTestSkipped($exception->getMessage());
-        }
-    }
-
-    /**
-     * @param int $rootPageId
-     * @param string $base
-     * @return array
-     */
-    private function buildSiteConfiguration(
-        int $rootPageId,
-        string $base = ''
-    ): array {
-        return [
-            'rootPageId' => $rootPageId,
-            'base' => $base,
-        ];
-    }
-
-    /**
-     * @param string $identifier
-     * @param string $base
-     * @return array
-     */
-    private function buildDefaultLanguageConfiguration(
-        string $identifier,
-        string $base
-    ): array {
-        $configuration = $this->buildLanguageConfiguration($identifier, $base);
-        $configuration['typo3Language'] = 'default';
-        $configuration['flag'] = 'global';
-        unset($configuration['fallbackType']);
-        return $configuration;
-    }
-
-    /**
-     * @param string $identifier
-     * @param string $base
-     * @param array $fallbackIdentifiers
-     * @return array
-     */
-    private function buildLanguageConfiguration(
-        string $identifier,
-        string $base,
-        array $fallbackIdentifiers = []
-    ): array {
-        $preset = $this->resolveLanguagePreset($identifier);
-
-        $configuration = [
-            'languageId' => $preset['id'],
-            'title' => $preset['title'],
-            'navigationTitle' => $preset['title'],
-            'base' => $base,
-            'locale' => $preset['locale'],
-            'iso-639-1' => $preset['iso'],
-            'hreflang' => $preset['hrefLang'],
-            'direction' => $preset['direction'],
-            'typo3Language' => $preset['iso'],
-            'flag' => $preset['iso'],
-            'fallbackType' => 'strict',
-        ];
-
-        if (!empty($fallbackIdentifiers)) {
-            $fallbackIds = array_map(
-                function (string $fallbackIdentifier) {
-                    $preset = $this->resolveLanguagePreset($fallbackIdentifier);
-                    return $preset['id'];
-                },
-                $fallbackIdentifiers
-            );
-            $configuration['fallbackType'] = 'fallback';
-            $configuration['fallbackType'] = implode(',', $fallbackIds);
-        }
-
-        return $configuration;
-    }
-
-    /**
-     * @param string $handler
-     * @param array $codes
-     * @return array
-     */
-    private function buildErrorHandlingConfiguration(
-        string $handler,
-        array $codes
-    ): array {
-        if ($handler === 'Page') {
-            $baseConfiguration = [
-                'errorContentSource' => '404',
-            ];
-        } elseif ($handler === 'Fluid') {
-            $baseConfiguration = [
-                'errorFluidTemplate' => 'typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/FluidError.html',
-                'errorFluidTemplatesRootPath' => '',
-                'errorFluidLayoutsRootPath' => '',
-                'errorFluidPartialsRootPath' => '',
-            ];
-        } elseif ($handler === 'PHP') {
-            $baseConfiguration = [
-                'errorPhpClassFQCN' => PhpError::class,
-            ];
-        } else {
-            throw new \LogicException(
-                sprintf('Invalid handler "%s"', $handler),
-                1533894782
-            );
-        }
-
-        $baseConfiguration['errorHandler'] = $handler;
-
-        return array_map(
-            function (int $code) use ($baseConfiguration) {
-                $baseConfiguration['errorCode'] = $code;
-                return $baseConfiguration;
-            },
-            $codes
-        );
-    }
-
-    /**
-     * @param string $identifier
-     * @return mixed
-     */
-    private function resolveLanguagePreset(string $identifier)
-    {
-        if (!isset(static::LANGUAGE_PRESETS[$identifier])) {
-            throw new \LogicException(
-                sprintf('Undefined preset identifier "%s"', $identifier),
-                1533893665
-            );
-        }
-        return static::LANGUAGE_PRESETS[$identifier];
-    }
 }