This is a sample plugin for the presentation I gave on Unit Testing to WordPress Des Moines on October 31, 2016.
PHPUnit is required to run the tests, as well as a local WordPress install with a database.
-
Clone this folder to the plugins folder of an active WordPress install
-
Install the test suite:
$ sh bin/install-wp-tests.sh dbname dbuser dbpass dbhost
-
Run tests:
$ phpunit