Ticket #29827: 29827.2.patch
File 29827.2.patch, 1.6 KB (added by , 10 years ago) |
---|
-
tests/phpunit/includes/testcase.php
10 10 protected $caught_deprecated = array(); 11 11 protected $expected_doing_it_wrong = array(); 12 12 protected $caught_doing_it_wrong = array(); 13 protected $registered_taxonomy = array(); 14 protected $registered_post_type = array(); 13 15 14 16 protected static $hooks_saved = array(); 15 17 protected static $ignore_files; … … 40 42 $this->start_transaction(); 41 43 $this->expectDeprecated(); 42 44 add_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); 45 add_action( 'registered_taxonomy', array( $this, 'object_registered' ) ); 46 add_action( 'registered_post_type', array( $this, 'object_registered' ) ); 43 47 } 44 48 45 49 function tearDown() { … … 57 61 remove_filter( 'query', array( $this, '_create_temporary_tables' ) ); 58 62 remove_filter( 'query', array( $this, '_drop_temporary_tables' ) ); 59 63 remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); 64 65 foreach ( $registered_taxonomy as $tax ) { 66 _unregister_taxonomy( $tax ); 67 } 68 foreach ( $registered_post_type as $pt ) { 69 _unregister_post_type( $pt ); 70 } 71 60 72 $this->_restore_hooks(); 61 73 } 62 74 … … 103 115 } 104 116 } 105 117 } 106 118 119 public function object_registered( $name ) { 120 $action = current_filter(); 121 $this->$object_registered[] = $name; 122 } 123 107 124 function flush_cache() { 108 125 global $wp_object_cache; 109 126 $wp_object_cache->group_ops = array();