Nimut / testing-framework

TYPO3 testing framework that provides base classes and configuration for PHPUnit tests
GNU General Public License v2.0
52 stars 25 forks source link

[TASK] Support frontend requests in case of helhum/typo3-secure-web #111

Open rostyslavmatviiv opened 5 years ago

rostyslavmatviiv commented 5 years ago

== 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.