diff --git tests/phpunit/includes/testcase.php tests/phpunit/includes/testcase.php
index 1e8ea11..7abceae 100644
|
|
|
class WP_UnitTestCase extends PHPUnit_Framework_TestCase { |
| 37 | 37 | ini_set('display_errors', 1 ); |
| 38 | 38 | $this->factory = new WP_UnitTest_Factory; |
| 39 | 39 | $this->clean_up_global_scope(); |
| | 40 | $this->reset_taxonomies(); |
| 40 | 41 | $this->start_transaction(); |
| 41 | 42 | $this->expectDeprecated(); |
| 42 | 43 | add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); |
| … |
… |
class WP_UnitTestCase extends PHPUnit_Framework_TestCase { |
| 67 | 68 | } |
| 68 | 69 | |
| 69 | 70 | /** |
| | 71 | * Unregister existing taxonomies and register defaults. |
| | 72 | * |
| | 73 | * Run before each test in order to clean up the global scope, in case |
| | 74 | * a test forgets to unregister a taxonomy on its own, or fails before |
| | 75 | * it has a chance to do so. |
| | 76 | */ |
| | 77 | protected function reset_taxonomies() { |
| | 78 | foreach ( get_taxonomies() as $tax ) { |
| | 79 | _unregister_taxonomy( $tax ); |
| | 80 | } |
| | 81 | create_initial_taxonomies(); |
| | 82 | } |
| | 83 | |
| | 84 | /** |
| 70 | 85 | * Saves the action and filter-related globals so they can be restored later. |
| 71 | 86 | * |
| 72 | 87 | * Stores $merged_filters, $wp_actions, $wp_current_filter, and $wp_filter |