# List the available scripts
composer run-script -l
composer show --self
composer show --direct
composer show --outdated
composer show --tree
Clone this repo, open PhpStorm, then run composer install
to install the dependencies.
git clone https://github.com/brianhenryie/plugin-slug.git;
open -a PhpStorm ./;
composer install;
See documentation on WordPress.org and GitHub.com.
Correct errors where possible and list the remaining with:
vendor/bin/phpcbf; vendor/bin/phpcs
Tests use the Codeception add-on WP-Browser and include vanilla PHPUnit tests with WP_Mock.
Run tests with:
vendor/bin/codecept run unit;
vendor/bin/codecept run wpunit;
vendor/bin/codecept run integration;
vendor/bin/codecept run acceptance;
Show code coverage (unit+wpunit):
XDEBUG_MODE=coverage composer run-script coverage-tests
vendor/bin/phpstan analyse --memory-limit 1G
To save changes made to the acceptance database:
export $(grep -v '^#' .env.testing | xargs)
mysqldump -u $TEST_SITE_DB_USER -p$TEST_SITE_DB_PASSWORD $TEST_SITE_DB_NAME > tests/_data/dump.sql
To clear Codeception cache after moving/removing test files:
vendor/bin/codecept clean