Ticket #56706: 56706.2.diff
File 56706.2.diff, 1.5 KB (added by , 2 years ago) |
---|
-
tests/phpunit/includes/abstract-testcase.php
280 280 * it has a chance to do so. 281 281 */ 282 282 protected function reset_post_types() { 283 foreach ( get_post_types( array(), 'objects' ) as $pt ) { 283 global $wp_post_types; 284 285 foreach ( $wp_post_types as $pt ) { 284 286 if ( empty( $pt->tests_no_auto_unregister ) ) { 285 287 _unregister_post_type( $pt->name ); 286 288 } 287 289 } 290 288 291 create_initial_post_types(); 289 292 } 290 293 … … 296 299 * it has a chance to do so. 297 300 */ 298 301 protected function reset_taxonomies() { 299 foreach ( get_taxonomies() as $tax ) { 300 _unregister_taxonomy( $tax ); 302 global $wp_taxonomies; 303 304 foreach ( $wp_taxonomies as $tax ) { 305 _unregister_taxonomy( $tax->name ); 301 306 } 307 302 308 create_initial_taxonomies(); 303 309 } 304 310 … … 306 312 * Unregisters non-built-in post statuses. 307 313 */ 308 314 protected function reset_post_statuses() { 309 foreach ( get_post_stati( array( '_builtin' => false ) ) as $post_status ) { 315 global $wp_post_statuses; 316 317 $non_built_in_post_statuses = array(); 318 319 foreach ( $wp_post_statuses as $post_status ) { 320 if ( false === $post_status->_builtin ) { 321 $non_built_in_post_statuses[ $post_status->name ] = $post_status->name; 322 } 323 } 324 325 foreach ( $non_built_in_post_statuses as $post_status ) { 310 326 _unregister_post_status( $post_status ); 311 327 } 312 328 }