A complete environment for wordpress plugins development using Docker, PHPUnit and PHPCodeSniffer.
git clone git@github.com:tonnysantana2004/wp-plugin-testing-environment.git
cd docker
PLUGIN_SLUG=my-plugin
docker compose up
This will create two folders, which are the docker volums for the wordpress and database instalation.
Futhermore, it will excecute the script responsible for generating the wordpress testing environment with phpunit.
composer install
Follow the cli instructions to ensure that everything was installed correctly.
docker exec -w /var/www/html/wp-content/plugins/the-perfect-gallery wordpress vendor/bin/phpunit
docker exec -w /var/www/html/wp-content/plugins/the-perfect-gallery wordpress vendor/bin/phpcs
"scripts" : {
"phpunit" : "docker exec -w /var/www/html/wp-content/plugins/the-perfect-gallery wordpress vendor/bin/phpunit",
"phpcs" : "docker exec -w /var/www/html/wp-content/plugins/the-perfect-gallery wordpress vendor/bin/phpcs"
}
> composer phpunit