Skip to content

Commit

Permalink
[WIP][TASK] Remove providing backend entrypoint for TYPO3 v13 in test…
Browse files Browse the repository at this point in the history
… instance

TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`)
and made the main entrypoint (`./index.php`) capable of handling
frontend and backend web requests to make the backend entrypoint
finally configurable and required to change the rewrite rules for
webservers to ensure backend requests hits the main entrypoint.

The acceptance setup for `b13/container` is based on the TYPO3
monorepo setup using a real `Apache2` webserver instead of the
PHP internal webserver and thus needs `.htaccess` rules to work.

Providing needed `.htaccess` files has been added to the TYPO3
monorepo only and broke the setup for acceptance testing against
TYPO3 v13. As a workaround providing the old backend entrypoint
file has been implemented within the extended codeception setup
method `BackendContainerEnvironment::bootstrapTypo3Environment()`
which worked but is literally wrong.

`typo3/testing-framework` now provides these files automatically,
and the wrong workaround can be removed to cleanup the code base
[1][2][3][4] and is backwards compatible for older TYPO3 versions.

One phpstan ignore pattern can be now removed from all baselines.

[1] TYPO3/testing-framework#663
[2] TYPO3/testing-framework#664
[3] ...
[4] ...
  • Loading branch information
sbuerk committed Dec 5, 2024
1 parent de93949 commit 9a52963
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 38 deletions.
5 changes: 0 additions & 5 deletions Build/phpstan-baseline-11-7.4.neon
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ parameters:
count: 1
path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php

-
message: "#^Constant ORIGINAL_ROOT not found\\.$#"
count: 1
path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php

-
message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#"
count: 1
Expand Down
5 changes: 0 additions & 5 deletions Build/phpstan-baseline-11.neon
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ parameters:
count: 1
path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php

-
message: "#^Constant ORIGINAL_ROOT not found\\.$#"
count: 1
path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php

-
message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#"
count: 1
Expand Down
5 changes: 0 additions & 5 deletions Build/phpstan-baseline-12.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ parameters:
count: 1
path: ../Tests/Acceptance/Support/BackendTester.php

-
message: "#^Constant ORIGINAL_ROOT not found\\.$#"
count: 1
path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php

-
message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#"
count: 1
Expand Down
5 changes: 0 additions & 5 deletions Build/phpstan-baseline-13.neon
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ parameters:
count: 1
path: ../Tests/Acceptance/Support/BackendTester.php

-
message: "#^Constant ORIGINAL_ROOT not found\\.$#"
count: 1
path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php

-
message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#"
count: 1
Expand Down
18 changes: 0 additions & 18 deletions Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,4 @@ public function _initialize(): void
}
parent::_initialize();
}

public function bootstrapTypo3Environment(SuiteEvent $suiteEvent): void
{
parent::bootstrapTypo3Environment($suiteEvent);
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
if ($typo3Version->getMajorVersion() < 13) {
return;
}
$content = "<?php
call_user_func(static function () {
\$classLoader = require __DIR__ . '/../../../../../..' . '/vendor/autoload.php';
\TYPO3\TestingFramework\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
\TYPO3\CMS\Core\Core\Bootstrap::init(\$classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});";
$instancePath = ORIGINAL_ROOT . 'typo3temp/var/tests/acceptance';
file_put_contents($instancePath . '/typo3/index.php', $content);
}
}

0 comments on commit 9a52963

Please sign in to comment.