diff --git a/tests/phpunit/tests/image/header.php b/tests/phpunit/tests/image/header.php index fce617fd7df4f..ffe864e3d55a5 100644 --- a/tests/phpunit/tests/image/header.php +++ b/tests/phpunit/tests/image/header.php @@ -8,11 +8,25 @@ class Tests_Image_Header extends WP_UnitTestCase { public $custom_image_header; + /** + * Original value of the `$_wp_theme_features` global. + * + * @var array + */ + private $orig_theme_features; + public function set_up() { parent::set_up(); + $this->orig_theme_features = $GLOBALS['_wp_theme_features']; $this->custom_image_header = new Custom_Image_Header( '__return_null' ); } + public function tear_down() { + $GLOBALS['_wp_theme_features'] = $this->orig_theme_features; + + parent::tear_down(); + } + public function test_header_image_has_correct_dimensions_with_max_width() { global $_wp_theme_features;