From e0d827b500e3cfaf1bbe6c9336d4a27026fb80e6 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 22 Nov 2023 11:01:23 +0100 Subject: [PATCH] [BUGFIX] Respect TYPO3_REQUEST in framework state (#518) Resolves: #517 --- Classes/Core/Functional/Framework/FrameworkState.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classes/Core/Functional/Framework/FrameworkState.php b/Classes/Core/Functional/Framework/FrameworkState.php index bfb2d258..94c2f03f 100644 --- a/Classes/Core/Functional/Framework/FrameworkState.php +++ b/Classes/Core/Functional/Framework/FrameworkState.php @@ -51,6 +51,7 @@ public static function push() // different. And code that runs after that within the test scope may fail (eg. the referenceIndex check in tearDown() that // relies on TCA). So we back up TCA for now before executing frontend tests. $state['globals-tca'] = $GLOBALS['TCA']; + $state['request'] = $GLOBALS['TYPO3_REQUEST'] ?? null; // Can be dropped when GeneralUtility::getIndpEnv() is abandoned $generalUtilityReflection = new \ReflectionClass(GeneralUtility::class); @@ -68,6 +69,7 @@ public static function push() public static function reset() { unset($GLOBALS['BE_USER']); + unset($GLOBALS['TYPO3_REQUEST']); $generalUtilityReflection = new \ReflectionClass(GeneralUtility::class); $generalUtilityIndpEnvCache = $generalUtilityReflection->getProperty('indpEnvCache'); @@ -92,6 +94,7 @@ public static function pop() } $GLOBALS['TCA'] = $state['globals-tca']; + $GLOBALS['TYPO3_REQUEST'] = $state['request']; $generalUtilityReflection = new \ReflectionClass(GeneralUtility::class); $generalUtilityIndpEnvCache = $generalUtilityReflection->getProperty('indpEnvCache');