Evaluate using PHP 5.4's internal web server for Functional Testing
|Priority:||Could have||Due date:|
|Category:||- Testing -|
PHP 5.4 offers the option to start an instance of a simple, tiny web server with for example
php -S localhost:8000
Just for the record; the doc root can also be defined:
php -S localhost:8000 -t /var/www/Web/
Maybe an additional Request Handler can be introduced, that kicks in if the request hits against that CLI server:
1 php_sapi_name() === 'cli-server'
I'd like to collect some ideas how that can be used in functional tests, at least for the Http support or something.
The question is how to differenciate between what to serve and what to expect. We could establish, for example, the following
- Expect the tester person to manually start the PHP server at a specified port which is also configured in some YAML. The server's document root has to match the Web document root, like everytime
- If whatever request comes, the above mentioned RequestHandler kicks in, and...
- routes to a file, for example, that is defined by a user-defined header in the appropriate Functional Test. This target file than can return whatever the actual function test expects
This is only some vague ideas in order to get started; I also could imagine that the real FLOW3 behavior is intended to get tested, for example 404 err handling or routing.