Task #37831

Evaluate using PHP 5.4's internal web server for Functional Testing

Added by Adrian Föder over 9 years ago.

Status:
New
Priority:
Could have
Assignee:
-
Category:
- Testing -
Target version:
-
Start date:
2012-06-08
Due date:
% Done:

0%

Estimated time:
Sprint:
PHP Version:
5.4
Has patch:
No
Complexity:

Description

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:

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.

No data to display

Also available in: Atom PDF