Changeset 29860
- Timestamp:
- 10/09/2014 12:57:26 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r29503 r29860 38 38 $this->factory = new WP_UnitTest_Factory; 39 39 $this->clean_up_global_scope(); 40 $this->reset_post_types(); 41 $this->reset_taxonomies(); 40 42 $this->start_transaction(); 41 43 $this->expectDeprecated(); … … 65 67 $_POST = array(); 66 68 $this->flush_cache(); 69 } 70 71 /** 72 * Unregister existing post types and register defaults. 73 * 74 * Run before each test in order to clean up the global scope, in case 75 * a test forgets to unregister a post type on its own, or fails before 76 * it has a chance to do so. 77 */ 78 protected function reset_post_types() { 79 foreach ( get_post_types() as $pt ) { 80 _unregister_post_type( $pt ); 81 } 82 create_initial_post_types(); 83 } 84 85 /** 86 * Unregister existing taxonomies and register defaults. 87 * 88 * Run before each test in order to clean up the global scope, in case 89 * a test forgets to unregister a taxonomy on its own, or fails before 90 * it has a chance to do so. 91 */ 92 protected function reset_taxonomies() { 93 foreach ( get_taxonomies() as $tax ) { 94 _unregister_taxonomy( $tax ); 95 } 96 create_initial_taxonomies(); 67 97 } 68 98
Note: See TracChangeset
for help on using the changeset viewer.