events/Patches/testing-framework-request-state.patch
Daniel Siepmann 81065f5c67
BREAKING: TYPO3 v12 support (#44)
* Migrated all fixtures to PHP.
* Removed version specific adjustments.
2023-11-27 10:04:42 +01:00

31 lines
1.6 KiB
Diff

Issue: https://github.com/TYPO3/testing-framework/issues/517
PR: https://github.com/TYPO3/testing-framework/pull/518
diff --git a/Classes/Core/Functional/Framework/FrameworkState.php b/Classes/Core/Functional/Framework/FrameworkState.php
index 93716fc..f900539 100644
--- a/Classes/Core/Functional/Framework/FrameworkState.php
+++ b/Classes/Core/Functional/Framework/FrameworkState.php
@@ -50,6 +50,7 @@ class FrameworkState
// 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);
@@ -67,6 +68,7 @@ class FrameworkState
public static function reset()
{
unset($GLOBALS['BE_USER']);
+ unset($GLOBALS['TYPO3_REQUEST']);
$generalUtilityReflection = new \ReflectionClass(GeneralUtility::class);
$generalUtilityIndpEnvCache = $generalUtilityReflection->getProperty('indpEnvCache');
@@ -91,6 +93,7 @@ class FrameworkState
}
$GLOBALS['TCA'] = $state['globals-tca'];
+ $GLOBALS['TYPO3_REQUEST'] = $state['request'];
$generalUtilityReflection = new \ReflectionClass(GeneralUtility::class);
$generalUtilityIndpEnvCache = $generalUtilityReflection->getProperty('indpEnvCache');