Instead of depending on a global environment variable
to set the TYPO3 environment in cli mode, we inject the mode
properly from within the entry point.
We now move the code to initialize the environment
to SystemEnvironmentBuilder:run() where we can evaluate
the request type passed to this method, to properly
set cli or non cli mode.
Depending on a global env to set the TYPO3 environment
would require hacks, like changing the global env to
properly select the cli mode (currently done in testing framework).
Using an application sub context for that purpose isn't ideal either,
because at best we would need to also test for magic contexts
like "Production/Frontend" or "Development/Frontend" and at worst
it conflicts with user defined contexts. It wouldn't be possible
to define a sub context and still properly start a frontend application
within this context.
composer req --dev typo3/testing-framework ~4.4.1