PhpBuiltinServer
Codeception extension to start and stop PHP built-in web server for your tests.
Codeception Branch |
PhpBuiltinServer Branch |
Status |
Codeception 1.x |
1.1.x |
|
Codeception 2.x |
1.2.x |
|
- Install Codeception via Composer
- Add
codeception/phpbuiltinserver: "*"
to your composer.json
- Run
composer install
- Include extensions into
codeception.yml
configuration:
paths:
tests: .
log: _log
data: _data
helpers: _helpers
extensions:
enabled:
- Codeception\Extension\PhpBuiltinServer
config:
Codeception\Extension\PhpBuiltinServer:
hostname: localhost
port: 8000
documentRoot: tests/_data
startDelay: 1
phpIni: /etc/php5/apache2/php.ini
example for projects based on Symfony
paths:
tests: .
log: _log
data: _data
helpers: _helpers
extensions:
enabled:
- Codeception\Extension\PhpBuiltinServer
config:
Codeception\Extension\PhpBuiltinServer:
hostname: localhost
port: 8000
documentRoot: ../web
router: ../web/app.php
directoryIndex: app.php
startDelay: 1
phpIni: /etc/php5/apache2/php.ini
additional configuration options:
Option Name |
Value |
Description |
alwaysUseRouter |
boolean (default: false) |
If enabled, all requests will use the specified router file regardless of if the file requested exists in the documentRoot |