You appear to be a bot. Output may be restricted
Description
After a test method runs, reset any state in WordPress the test method might have changed.
Usage
WP_UnitTestCase::tearDown();
Parameters
Returns
voidSource
File name: oik-batch/tests/testcase.phpLines:
1 to 24 of 24
function tearDown() { global $wpdb, $wp_query, $wp; $wpdb->query( 'ROLLBACK;'); if ( is_multisite() ) { while ( ms_is_switched() ) { restore_current_blog(); } } $wp_query = new WP_Query(); $wp = new WP(); // Reset globals related to the post loop and `setup_postdata()`. $post_globals = array( 'post', 'id', 'authordata', 'currentday', 'currentmonth', 'page', 'pages', 'multipage', 'more', 'numpages' ); foreach ( $post_globals as $global ) { $GLOBALS[ $global ] = null; } remove_theme_support( 'html5' ); remove_filter( 'query', array( $this, '_create_temporary_tables' ) ); remove_filter( 'query', array( $this, '_drop_temporary_tables' ) ); remove_filter( 'wp_die_handler', array( $this, 'get_wp_die_handler' ) ); $this->_restore_hooks(); wp_set_current_user( 0 ); }View on GitHub