Unit testing WordPress plugins and themes is quickly becoming one of the hottest topics in the WordPress realm. Yet, it also remains one of the most underused tools by WordPress developers. This session aims to get you on the way to reaping the benefits of unit testing.
First, we’ll start with which types of projects (particularly plugins & themes) should be unit testing, using a cost-benefit style analysis, so you can get a clear idea of which projects you should be using unit testing on and which to pass on. Next, a dive into how you actually go about doing it and what your options are for unit testing in PHP, and to a limited extent Javascript, and Browser Output testing. We’ll also discuss common mistakes and best practices in PHP unit testing.
We’ll then discuss types of services that can make unit testing your theme or plugin easier, both hosted services like Travis-CI, CircleCI, and Coveralls and open-source options such as Jenkins and PHPCI. Finally, we’ll take a look at Easy Digital Downloads’s unit testing framework and observe a production unit testing framework.