*** WORK IN PROGRESS ***, (*2)
When you develop a plugin for WordPress it's important to also build test cases and use them continuous., (*3)
This package is a helper to run tests within your plugin folder but use Docker as a testing instance and report generator., (*4)
The testsuite should be placed within a plugin that's going to be tested., (*5)
root │ wp-admin └───wp-content ├───plugins │ ├───your-plugin <- install with composer require ekandreas/testrunner:* │ │ ...
Note! First time is going to take a long time due to creating images and installing wordpress-develop folder, etc., (*6)
To continuously run tests to a plugin use the partitial test command:, (*7)
dep tests:run
Install this lib with composer, eg:, (*8)
composer require ekandreas/testrunner:dev-master
Now create a deployment file in root of your plugin, eg:, (*9)
<!-- deploy.php --> date_default_timezone_set('Europe/Stockholm'); include_once 'vendor/ekandreas/testrunner/recipe.php';
You can now enjoy tests with docker with the following deployment command:, (*10)
vendor/bin/dep tests
This is only the first time, aprox 10 min first time., (*11)
And with continuous tests:, (*12)
vendor/bin/dep tests:run
Only seconds to a test report., (*13)
<?php date_default_timezone_set('Europe/Stockholm'); include_once 'vendor/ekandreas/testrunner/recipe.php'; set( 'docker_host_name', 'tests');
vendor/bin/dep tests
dep tests:up
dep tests:rebuild
dep tests:run
This will kill the containers, (*14)
dep tests:stop
This will kill the virtual test machine, (*15)
dep tests:kill
If you don't want to use the default docker-machine, define your own, eg:, (*16)
<!-- deploy.php --> date_default_timezone_set('Europe/Stockholm'); include_once 'vendor/ekandreas/testrunner/recipe.php'; set( 'docker_host_name', 'tests');
If you don't have a docker machine setup then the deploy script will try to create it for you. Virtualbox as default., (*17)
dep tests
to check and startup mysql and install if missing.