Пример #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();
 }
Пример #2
0
 public function tearDown()
 {
     parent::tearDown();
     unset($this->shortcodeParser);
     unset($this->imageId);
     unset($this->imageSize);
     unset($this->imageWidth);
     unset($this->imageHeight);
     unset($this->imageLink);
 }
Пример #3
0
 /**
  * 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);
 }
Пример #4
0
 public function tearDown()
 {
     parent::tearDown();
     unset($this->pluginInstance);
 }
Пример #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);
 }
Пример #7
0
 /**
  * Clean up after a test method.
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->fragment = null;
 }
Пример #8
0
 public function tearDown()
 {
     parent::tearDown();
     $_COOKIE = array();
     $_POST = array();
 }
Пример #9
0
 /**
  * Clean up after a test method.
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->callback = null;
     $this->shortcode = null;
 }