mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
Build/Test Tools: Document PHP unit test classes.
Props boonebgorges. Fixes #35494. git-svn-id: https://develop.svn.wordpress.org/trunk@36854 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3,6 +3,15 @@
|
||||
require_once dirname( __FILE__ ) . '/factory.php';
|
||||
require_once dirname( __FILE__ ) . '/trac.php';
|
||||
|
||||
/**
|
||||
* Defines a basic fixture to run multiple tests.
|
||||
*
|
||||
* Resets the state of the WordPress installation before and after every test.
|
||||
*
|
||||
* Includes utility functions and assertions useful for testing WordPress.
|
||||
*
|
||||
* All WordPress unit tests should inherit from this class.
|
||||
*/
|
||||
class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
|
||||
protected static $forced_tickets = array();
|
||||
@@ -124,6 +133,9 @@ class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
||||
$this->expectedDeprecated();
|
||||
}
|
||||
|
||||
/**
|
||||
* After a test method runs, reset any state in WordPress the test method might have changed.
|
||||
*/
|
||||
function tearDown() {
|
||||
global $wpdb, $wp_query, $wp, $post;
|
||||
$wpdb->query( 'ROLLBACK' );
|
||||
|
||||
Reference in New Issue
Block a user