Codeception Drupal Drush Server
Branch |
Status |
Master |
 |
Codeception extension for starting and stopping a Drush server using PHP's built in webserver and the drush runserver
command., (*1)
Requirements
- Drush
- PHP 5.4 (the Drush server does support PHP 5.3, but I'm not likely to actively test this. Pull requests welcome if this is required :))
Installation
Via Composer, (*2)
``` bash
$ composer require chapabu/codeception-drupal-runserver --dev, (*3)
## Usage
``` yaml
paths:
tests: .
log: _log
data: _data
helpers: _helpers
extensions:
enabled:
- Codeception\Extension\DrushRunserver
config:
Codeception\Extension\DrushRunserver:
drupalRoot: docroot
drushBinary: ../vendor/bin/drush
hostname: 127.0.0.1
port: 8080
variables:
site_name: My cool site
theme_default: my_awesome_theme
site_mail: admin@example.com
Configuration options
drupalRoot
``` yaml
drupalRoot: docRoot, (*4)
The folder (relative to your `codecept.yml` file) where your Drupal installation resides (default: same directory as `codecept.yml`).
#### drushBinary
``` yaml
drushBinary: ../vendor/bin/drush
The path to the Drush binary on your system (default: drush
- as if it were installed globally)., (*5)
hostname
``` yaml
hostname: 127.0.0.1, (*6)
The address to bind to the server (default: `127.0.0.1`).
#### port
``` yaml
port: 8080
````
The port number to bind to the server (default: `8888`).
#### variables
``` yaml
variables:
site_name: My cool site
theme_default: my_awesome_theme
site_mail: admin@example.com
A key-value array of variables to override in the$conf
array for the running site., (*7)
Testing
bash
$ codecept run
, (*8)
Credits
Most of the code for this was lifted from https://github.com/tiger-seo/PhpBuiltinServer, but rejigged to use the drush runserver
command., (*9)
License
The MIT License (MIT). Please see License File for more information., (*10)