Skip to content

Commit 283dee0

Browse files
committed
[BUGFIX] Ensure to take test instance as class mode instance
The bugfix backport to ensure correct system environment path building to fix issue TYPO3#577 missed to correctly set the flag for non-composer mode for TYPO3 v12 and lead to wrong path calculations and followup issues within functional tests. This is fixed by handing over a correct override value within the functional test bootstrap. [1] TYPO3#577 [2] TYPO3#633 Resolves: TYPO3#658 Related: TYPO3#633 Related: TYPO3@409c2b8 Releases: 8 Backported from dd7505b
1 parent b2a085d commit 283dee0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Classes/Core/SystemEnvironmentBuilder.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@
4040
*/
4141
class SystemEnvironmentBuilder extends CoreSystemEnvironmentBuilder
4242
{
43-
public static function run(int $entryPointLevel = 0, int $requestType = CoreSystemEnvironmentBuilder::REQUESTTYPE_FE, bool $composerMode = false)
43+
protected static ?bool $composerMode = null;
44+
public static function run(int $entryPointLevel = 0, int $requestType = CoreSystemEnvironmentBuilder::REQUESTTYPE_FE, ?bool $composerMode = null)
4445
{
46+
static::$composerMode = $composerMode;
4547
CoreSystemEnvironmentBuilder::run($entryPointLevel, $requestType);
4648
Environment::initialize(
4749
Environment::getContext(),
4850
Environment::isCli(),
49-
$composerMode,
51+
static::usesComposerClassLoading(),
5052
Environment::getProjectPath(),
5153
Environment::getPublicPath(),
5254
Environment::getVarPath(),
@@ -55,4 +57,9 @@ public static function run(int $entryPointLevel = 0, int $requestType = CoreSyst
5557
Environment::isWindows() ? 'WINDOWS' : 'UNIX'
5658
);
5759
}
60+
61+
protected static function usesComposerClassLoading(): bool
62+
{
63+
return static::$composerMode ?? parent::usesComposerClassLoading();
64+
}
5865
}

Classes/Core/Testbase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ public function setUpBasicTypo3Bootstrap($instancePath): ContainerInterface
702702
GeneralUtility::purgeInstances();
703703

704704
$classLoader = require $this->getPackagesPath() . '/autoload.php';
705-
SystemEnvironmentBuilder::run(1, SystemEnvironmentBuilder::REQUESTTYPE_BE | SystemEnvironmentBuilder::REQUESTTYPE_CLI);
705+
SystemEnvironmentBuilder::run(1, SystemEnvironmentBuilder::REQUESTTYPE_BE | SystemEnvironmentBuilder::REQUESTTYPE_CLI, false);
706706
$container = Bootstrap::init($classLoader);
707707
// Make sure output is not buffered, so command-line output can take place and
708708
// phpunit does not whine about changed output bufferings in tests.

0 commit comments

Comments
 (0)