/** * Clean up the global query object if necessary. */ protected function cleanGlobals() { if (class_exists('WP_Query') && property_exists('WP_Query', '__posts')) { \WP_Query::$__posts = \WP_Query::$__data = array(); \WP_Query::$__instance = null; } parent::cleanGlobals(); }
public function tearDown() { parent::tearDown(); unset($this->shortcodeParser); unset($this->imageId); unset($this->imageSize); unset($this->imageWidth); unset($this->imageHeight); unset($this->imageLink); }
/** * Define constants after requires/includes * * See http://kpayne.me/2012/07/02/phpunit-process-isolation-and-constant-already-defined/ * for more details * * @param \Text_Template $template */ public function prepareTemplate(\Text_Template $template) { $template->setVar(['globals' => '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = \'' . $GLOBALS['__PHPUNIT_BOOTSTRAP'] . '\';']); parent::prepareTemplate($template); }
public function tearDown() { parent::tearDown(); unset($this->pluginInstance); }
/** * Setup a test method. * * Mocks WordPress APIs. */ public function setUp() { parent::setUp(); $this->base_path = __DIR__ . '/templates'; $this->queried_object = (object) array('has_archive' => false, 'name' => null, 'post_type' => (object) array('name' => null), 'post_name' => null, 'slug' => null, 'taxonomy' => null, 'term' => null); }
public function setUp() { parent::setUp(); RouvenHurling\Nonces\time(self::$time); }
/** * Clean up after a test method. */ public function tearDown() { parent::tearDown(); $this->fragment = null; }
public function tearDown() { parent::tearDown(); $_COOKIE = array(); $_POST = array(); }
/** * Clean up after a test method. */ public function tearDown() { parent::tearDown(); $this->callback = null; $this->shortcode = null; }