diff --git tests/phpunit/includes/factory.php tests/phpunit/includes/factory.php
index e9c4743..d5f46d8 100644
|
|
|
|
| 1 | 1 | <?php |
| 2 | 2 | |
| | 3 | /** |
| | 4 | * A factory for making WordPress data with a cross-object type API. |
| | 5 | * |
| | 6 | * Tests should use this factory to generate test fixtures. |
| | 7 | */ |
| 3 | 8 | class WP_UnitTest_Factory { |
| 4 | 9 | |
| 5 | 10 | /** |
| … |
… |
class WP_UnitTest_Factory_For_Term extends WP_UnitTest_Factory_For_Thing {
|
| 296 | 301 | } |
| 297 | 302 | } |
| 298 | 303 | |
| | 304 | /** |
| | 305 | * An abstract class that serves as a basis for all WordPress object-type factory classes. |
| | 306 | */ |
| 299 | 307 | abstract class WP_UnitTest_Factory_For_Thing { |
| 300 | 308 | |
| 301 | 309 | var $default_generation_definitions; |
diff --git tests/phpunit/includes/testcase.php tests/phpunit/includes/testcase.php
index a468deb..71b8ed4 100644
|
|
|
|
| 3 | 3 | require_once dirname( __FILE__ ) . '/factory.php'; |
| 4 | 4 | require_once dirname( __FILE__ ) . '/trac.php'; |
| 5 | 5 | |
| | 6 | /** |
| | 7 | * Defines a basic fixture to run multiple tests. |
| | 8 | * |
| | 9 | * Resets the state of the WordPress installation before and after every test. |
| | 10 | * |
| | 11 | * Includes utility functions and assertions useful for testing WordPress. |
| | 12 | * |
| | 13 | * All WordPress unit tests should inherit from this class. |
| | 14 | */ |
| 6 | 15 | class WP_UnitTestCase extends PHPUnit_Framework_TestCase { |
| 7 | 16 | |
| 8 | 17 | protected static $forced_tickets = array(); |
| … |
… |
class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
|
| 123 | 132 | $this->expectedDeprecated(); |
| 124 | 133 | } |
| 125 | 134 | |
| | 135 | /** |
| | 136 | * After a test method runs, reset any state in WordPress the test method might have changed. |
| | 137 | */ |
| 126 | 138 | function tearDown() { |
| 127 | 139 | global $wpdb, $wp_query, $wp, $post; |
| 128 | 140 | $wpdb->query( 'ROLLBACK' ); |