Unit and integration testing

Unit testing is used to test each small component independent from others, while integration testing is used to test the application in combination with all the modules. These two tests fall into the functional category, as we are checking the functionality and logic of our code. Compared to other popular frameworks, WordPress code is not the easiest to test. However, we can use PHPUnit for testing themes as well as plugins in WordPress. Installing and implementing test cases with PHPUnit is beyond the scope of this chapter. You can find a guide for working with PHPUnit at http://make.wordpress.org/core/handbook/automated-testing/.

WordPress provides a set of test cases for testing major features. Many developers ...

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.