Skip to content

Commit 08f4809

Browse files
committed
Empty out added theme supports before running tests
1 parent 1e5797c commit 08f4809

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/phpunit/tests/template.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,27 @@ public function set_up() {
122122
remove_filter( 'should_load_block_assets_on_demand', '__return_true', 0 );
123123
remove_action( 'wp_template_enhancement_output_buffer_started', 'wp_hoist_late_printed_styles' );
124124

125-
global $wp_scripts, $wp_styles;
125+
global $wp_scripts, $wp_styles, $_wp_theme_features;
126126
$this->original_wp_scripts = $wp_scripts;
127127
$this->original_wp_styles = $wp_styles;
128128
$wp_scripts = null;
129129
$wp_styles = null;
130130
wp_scripts();
131131
wp_styles();
132132

133-
$this->original_theme_features = $GLOBALS['_wp_theme_features'];
133+
$this->original_theme_features = $_wp_theme_features;
134+
$_wp_theme_features = array();
134135
foreach ( self::RESTORED_CONFIG_OPTIONS as $option ) {
135136
$this->original_ini_config[ $option ] = ini_get( $option );
136137
}
137138
}
138139

139140
public function tear_down() {
140-
global $wp_scripts, $wp_styles;
141+
global $wp_scripts, $wp_styles, $_wp_theme_features;
141142
$wp_scripts = $this->original_wp_scripts;
142143
$wp_styles = $this->original_wp_styles;
143144

144-
$GLOBALS['_wp_theme_features'] = $this->original_theme_features;
145+
$_wp_theme_features = $this->original_theme_features;
145146
foreach ( $this->original_ini_config as $option => $value ) {
146147
ini_set( $option, $value );
147148
}

0 commit comments

Comments
 (0)