Esempio n. 1
0
 /**
  * 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);
 }
Esempio n. 4
0
 public function tearDown()
 {
     parent::tearDown();
     unset($this->pluginInstance);
 }
Esempio n. 5
0
 /**
  * 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);
 }
Esempio n. 7
0
 /**
  * Clean up after a test method.
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->fragment = null;
 }
Esempio n. 8
0
 public function tearDown()
 {
     parent::tearDown();
     $_COOKIE = array();
     $_POST = array();
 }
Esempio n. 9
0
 /**
  * Clean up after a test method.
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->callback = null;
     $this->shortcode = null;
 }