Codeception\TestCase\WPTestCase::tearDown PHP Method

tearDown() public method

public tearDown ( )
    function tearDown()
    {
        global $wpdb, $wp_query, $wp, $post;
        $wpdb->query('ROLLBACK');
        if (is_multisite()) {
            while (ms_is_switched()) {
                restore_current_blog();
            }
        }
        $wp_query = new \WP_Query();
        $wp = new \WP();
        $post = 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);
        parent::tearDown();
    }

Usage Example

 public function tearDown()
 {
     // your tear down methods here
     // then
     parent::tearDown();
     Test::tearDown();
 }