WordPress already has an automated testing suite. What you see here is an alternative testing framework, with the following goals:
- faster
- runs every test case in a clean WordPress install
- uses the default PHPUnit runner, instead of custom one
- doesn't encourage or support the usage of shared/prebuilt fixtures
It uses SQL transactions to clean up automatically after each test.
- WordPress 3.5-alpha
- phpunit
- Clone the project.
- Copy
unittests-config-sample.php
tounittests-config.php
. - Edit the config. USE A NEW DATABASE, BECAUSE ALL THE DATA INSIDE WILL BE DELETED.
- $ phpunit all
- $ phpunit test_test.php