pieces of code ("units") in your plugin work as they were intended to. • Unit tests are fast. • Unit tests are reliable. • Unit tests are flexible. What are Unit Tests?
Tracker ◦ http://unit-test.trac.wordpress.org/ ◦ http://unit-test.svn.wordpress.org/ • 1,366 Tests Currently • For the fans of git out there, you really should just use SVN here for now. • See the Core Contributor Handbook: ◦ make.wordpress.org/core/handbook/automated-testing Core Tests Architecture
run multisite, use -c multisite.xml Not running ajax tests... To execute these, use --group ajax. PHPUnit 3.6.11 by Sebastian Bergmann. Configuration read from phpunit.xml .S. Time: 1 second, Memory: 41.00Mb OK, but incomplete or skipped tests! Tests: 3, Assertions: 2, Skipped: 1. Run the Tests!
run with your plugin activated by adding this code to the beginning of wordpress-tests/bootstrap.php: $GLOBALS['wp_tests_options' ] = array( 'active_plugins' => array( "WP_Slider_Captcha/wp-slider-captcha.php" ), ); Does Your Plugin Break Anything in WordPress Itself?
CI with your GitHub repo, then push the changes to your plugin on GitHub. Travis CI Settings # Versions of PHP to test against php: - "5.2" - "5.3" - "5.4" # Versions of WordPress to test against # WP_VERSION = WordPress version number # WP_MULTISITE = Enable Multisite? env: - WP_VERSION=master WP_MULTISITE=0 - WP_VERSION=3.4.2 WP_MULTISITE=0 - WP_VERSION=3.3.3 WP_MULTISITE=0 - WP_VERSION=3.2.1 WP_MULTISITE=0