Skip to content

Commit

Permalink
[BUGFIX] Respect TYPO3_REQUEST in framework state (#518)
Browse files Browse the repository at this point in the history
Resolves: #517
  • Loading branch information
DanielSiepmann authored Nov 22, 2023
1 parent 6fd0cfd commit e0d827b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Core/Functional/Framework/FrameworkState.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit e0d827b

Please sign in to comment.