WP_Ajax_UnitTestCase::tearDown PHP Method

tearDown() public method

Reset $_POST, remove the wp_die() override, restore error reporting
public tearDown ( )
    public function tearDown()
    {
        parent::tearDown();
        $_POST = array();
        $_GET = array();
        unset($GLOBALS['post']);
        unset($GLOBALS['comment']);
        remove_filter('wp_die_ajax_handler', array($this, 'getDieHandler'), 1, 1);
        remove_action('clear_auth_cookie', array($this, 'logout'));
        error_reporting($this->_error_level);
        set_current_screen('front');
    }

Usage Example

Example #1
0
 /**
  * Tear down the test fixture.
  */
 public function tearDown()
 {
     // Cleanup
     foreach ($this->_ids as $id) {
         wp_delete_attachment($id, true);
     }
     parent::tearDown();
 }
All Usage Examples Of WP_Ajax_UnitTestCase::tearDown