WP with WP-Cli and PHP ZipArchive, Subversion, PHPUnit, PHPCBF and PHPCS.
2.3K
Latest WordPress with:
While this image integrates PHPUnit, it does not configure unit testing for your plugin automatically. But no worries, it's quite straightforward.
First, connect to an interactive shell in your container and add PHPUnit testing with WP Cli, where "your-plugin-name" is the folder name of the plugin you want to add the tests to:
docker exec -it <container_name> /bin/bash
wp scaffold plugin-tests your-plugin-name
Then cd into the plugin's folder and run the installation script provided
cd wp-content/plugins/your-plugin-name
bin/install-wp-tests.sh wordpress_test username 'password' localhost:3306 latest
Replace the values accordingly, with "localhost" being the name of your database container specified in the docker configuration (e.g. docker-compose.yml).
You can verify that unit testing is installed properly by running
phpunit tests/test-sample.php
from your plugin folder.
Content type
Image
Digest
Size
169 MB
Last updated
almost 8 years ago
docker pull jankoch/wordpress