Skip to content

Commit

Permalink
[BUGFIX] Check for install.php existance (#567)
Browse files Browse the repository at this point in the history
TF 8.1.0 removed 'composer req' of typo3/cms-install.
Extension functional tests may now fail when trying
to create the 'install.php' link - the file no longer
exists if the extension itself has no requirement to
typo3/cms-install, which most extensions don't have.

Resolves: #566
  • Loading branch information
lolli42 authored Jun 21, 2024
1 parent ee9f3da commit 4409155
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Classes/Core/Functional/FunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ protected function setUp(): void
'extbase',
'fluid',
];
if ((new Typo3Version())->getMajorVersion() < 13) {
if ((new Typo3Version())->getMajorVersion() < 13
&& class_exists(\TYPO3\CMS\Install\Exception::class)
) {
// @todo: Remove with next major TF version
$defaultCoreExtensionsToLoad[] = 'install';
}
Expand Down
7 changes: 5 additions & 2 deletions Classes/Core/Testbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,22 @@ public function setUpInstanceCoreLinks(
// of the testing framework.
// @todo: Remove else branch when dropping support for v12
$hasConsolidatedHttpEntryPoint = class_exists(CoreHttpApplication::class);
$installPhpExists = file_exists($instancePath . '/typo3/sysext/install/Resources/Private/Php/install.php');
if ($hasConsolidatedHttpEntryPoint) {
$entryPointsToSet = [
$instancePath . '/typo3/sysext/core/Resources/Private/Php/index.php' => $instancePath . '/index.php',
];
if (in_array('install', $coreExtensions, true)) {
if ($installPhpExists && in_array('install', $coreExtensions, true)) {
$entryPointsToSet[$instancePath . '/typo3/sysext/install/Resources/Private/Php/install.php'] = $instancePath . '/typo3/install.php';
}
} else {
$entryPointsToSet = [
$instancePath . '/typo3/sysext/backend/Resources/Private/Php/backend.php' => $instancePath . '/typo3/index.php',
$instancePath . '/typo3/sysext/frontend/Resources/Private/Php/frontend.php' => $instancePath . '/index.php',
$instancePath . '/typo3/sysext/install/Resources/Private/Php/install.php' => $instancePath . '/typo3/install.php',
];
if ($installPhpExists) {
$entryPointsToSet[$instancePath . '/typo3/sysext/install/Resources/Private/Php/install.php'] = $instancePath . '/typo3/install.php';
}
}
$autoloadFile = dirname(__DIR__, 4) . '/autoload.php';

Expand Down

0 comments on commit 4409155

Please sign in to comment.