Josh's WordPress plugin starter
Name |
---|
Getting Started |
PHP |
JavaScript |
Local Development |
CI/ CD |
PHP code goes in the directory “php” or “tests”. The psr-4 standard is used for file and class naming. Composer is used for an autoloader and for dev dependencies.
The php tests are separated into two genres: unit – located in /tests/Unit
– and integration – located in /tests/Integration
.
Unit Testing Classes That Call Functions From WordPress core
These tests do NOT run with WordPress and MySQL and are run with phpunit.
composer install
composer test
The following unit testing tools are installed:
These tests are dependent on WordPress and MySQL and are run with phpunit.
Run WordPress Integration Tests
composer test:wordpress
docker-compose run phpunit
composer install
# install for development inside of the container.composer:test:wordpress