Automated Testing For WordPress Plugins

WordPress users have had enough of buggy plugins and the dreaded white screen of death. We all make mistakes and no one is perfect. Luckily we can use automated tests to make sure our code works as expected.

Plugin Machine can be used to add php and JavaScript tests

PHP Testing

Plugin Machine gives you the option to use phpunit for two types of tests

  • Unit tests
    • Runs with no dependencies.
  • Integration tests
    • Runs in Docker with WordPress and MySQL
https://pluginmachine.com/blog/doc/php-testing/

Learn test-driven WordPress development

JavaScript Testing

Add tests for your blocks or other JavaScript code using:

https://pluginmachine.com/blog/doc/javascript-testing/

Local Development

Plugin Machine provides a complete WordPress local development environment, that can be configured to include:

  • WordPress Site
  • WP CLI
  • WordPress test runner
https://pluginmachine.com/blog/doc/local-development/