diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index 7dd0fddde9bb6..ee93c99c58fca 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -396,6 +396,9 @@ public function tear_down() { $GLOBALS[ $global ] = null; } + // Reset the Customizer global so that `is_customize_preview()` is false when the next test runs. + $GLOBALS['wp_customize'] = null; + // Reset comment globals. $comment_globals = array( 'comment_alt', 'comment_depth', 'comment_thread_alt', 'in_comment_loop' ); foreach ( $comment_globals as $global ) {