This repository has been archived by the owner on Jun 30, 2023. It is now read-only.
[TASK] Support frontend requests in case of helhum/typo3-secure-web #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
== Description ==
On our project we are using helhum/typo3-secure-web package together with nimut/testing-framework, and we got an issue when running FunctionalTests together with frontend requests.
As we are using helhum/typo3-secure-web we have a private folder and public folder in the project. And we wrote a functional test to check if frontend request will response with the data we expect (we are using this: https://github.com/Nimut/testing-framework#frontend-requests), TYPO3_PATH_ROOT is set to the private folder, however /private/index.php file is empty, and because of that frontend answers with empty response. So looks like nimut/testing-framework doesn't expect a compatibility with helhum/typo3-secure-web.
== What was changed? ==
As I see TYPO3_PATH_WEB is used in the code too, but actually in the current state it is only used to define ORIGINAL_ROOT in case when TYPO3_PATH_ROOT isn't set.
So we are defining a new constant ORIGINAL_WEB which will use value from TYPO3_PATH_WEB or if it is empty then from TYPO3_PATH_ROOT. In this case we can separate our private environment and public environment by next constants: ORIGINAL_ROOT and ORIGINAL_WEB, which will have the same value in the code in case when user sets only one of them.
And in the place where we are preparing testing environment we are linking our index.php from testing env to the index.php from root which is set by TYPO3_PATH_WEB.