Changeset 31046
- Timestamp:
- 01/04/2015 08:05:53 PM (10 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r30687 r31046 48 48 $this->reset_post_types(); 49 49 $this->reset_taxonomies(); 50 $this->reset_post_statuses(); 50 51 } 51 52 … … 106 107 } 107 108 create_initial_taxonomies(); 109 } 110 111 /** 112 * Unregister non-built-in post statuses. 113 */ 114 protected function reset_post_statuses() { 115 foreach ( get_post_stati( array( '_builtin' => false ) ) as $post_status ) { 116 _unregister_post_status( $post_status ); 117 } 108 118 } 109 119 -
trunk/tests/phpunit/includes/utils.php
r30528 r31046 332 332 } 333 333 334 /** 335 * Unregister a post status. 336 * 337 * @since 4.2.0 338 * 339 * @param string $status 340 */ 341 function _unregister_post_status( $status ) { 342 unset( $GLOBALS['wp_post_statuses'][ $status ] ); 343 } 344 334 345 function _cleanup_query_vars() { 335 346 // clean out globals to stop them polluting wp and wp_query -
trunk/tests/phpunit/tests/includes/helpers.php
r30687 r31046 160 160 } 161 161 } 162 163 public function test__unregister_post_status() { 164 register_post_status( 'foo' ); 165 _unregister_post_status( 'foo' ); 166 167 $stati = get_post_stati(); 168 169 $this->assertFalse( isset( $stati['foo'] ) ); 170 } 162 171 }
Note: See TracChangeset
for help on using the changeset viewer.