From 2533fb7888acd1ad5bde257f416bfd1b55a96df5 Mon Sep 17 00:00:00 2001 From: Mayank Majeji <2611064+mayankmajeji@users.noreply.github.com> Date: Tue, 24 Nov 2026 02:53:02 +0530 Subject: [PATCH] Tests: Restore theme features after each `Tests_Image_Header` test. The image header tests write custom header dimensions into `$_wp_theme_features`. A later `add_theme_support( 'custom-header' )` call picks them up and defines the header size constants, so the REST themes custom header test sees 1200 x 230. See #66755. --- tests/phpunit/tests/image/header.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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;