Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions tests/phpunit/includes/abstract-testcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ public function tearDown() {
$GLOBALS[ $global ] = null;
}

// Reset $wp_sitemap global so that sitemap-related dynamic $wp->public_query_vars are added when the next test runs.
$GLOBALS['wp_sitemaps'] = null;

$this->unregister_all_meta_keys();
remove_theme_support( 'html5' );
remove_filter( 'query', array( $this, '_create_temporary_tables' ) );
Expand Down
4 changes: 4 additions & 0 deletions tests/phpunit/tests/query/vars.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Tests_Query_Vars extends WP_UnitTestCase {

/**
* @ticket 35115
* @ticket 51154
*/
public function testPublicQueryVarsAreAsExpected() {
global $wp;
Expand Down Expand Up @@ -70,6 +71,9 @@ public function testPublicQueryVarsAreAsExpected() {
// Dynamically added public query vars:
'post_format',
'rest_route',
'sitemap',
'sitemap-subtype',
'sitemap-stylesheet',

),
$wp->public_query_vars,
Expand Down