Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/phpunit/tests/rewrite/rewriteTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ class Tests_Rewrite_Tags extends WP_UnitTestCase {
protected $rewritereplace;
protected $queryreplace;

/**
* The `WP_Rewrite` instance from before the test.
*
* @var WP_Rewrite
*/
private $orig_wp_rewrite;

public function set_up() {
global $wp_rewrite;
parent::set_up();

$this->orig_wp_rewrite = $wp_rewrite;

$wp_rewrite = new WP_Rewrite();
$wp_rewrite->init();

Expand All @@ -20,6 +29,12 @@ public function set_up() {
$this->queryreplace = $wp_rewrite->queryreplace;
}

public function tear_down() {
$GLOBALS['wp_rewrite'] = $this->orig_wp_rewrite;

parent::tear_down();
}

/**
* @dataProvider data_add_rewrite_tag_invalid
*
Expand Down
Loading