diff --git tests/phpunit/tests/customize/custom-css-setting.php tests/phpunit/tests/customize/custom-css-setting.php
index 63f55364c3..ae74da5c28 100644
--- tests/phpunit/tests/customize/custom-css-setting.php
+++ tests/phpunit/tests/customize/custom-css-setting.php
@@ -23,24 +23,32 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
 	public $setting;
 
 	/**
-	 * Set up the test case.
+	 * Administrator user id.
 	 *
-	 * @see WP_UnitTestCase::setup()
+	 * @var int
 	 */
-	function setUp() {
-		parent::setUp();
+	public static $user_id;
+
+	public static function wpSetUpBeforeClass() {
 		require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
 
-		$user_id = self::factory()->user->create(
+		self::$user_id = self::factory()->user->create(
 			array(
 				'role' => 'administrator',
 			)
 		);
 		if ( is_multisite() ) {
-			grant_super_admin( $user_id );
+			grant_super_admin( self::$user_id );
 		}
+	}
 
-		wp_set_current_user( $user_id );
+	/**
+	 * Set up the test case.
+	 *
+	 * @see WP_UnitTestCase::setup()
+	 */
+	function setUp() {
+		parent::setUp();
 
 		global $wp_customize;
 		$this->wp_customize = new WP_Customize_Manager();
@@ -49,6 +57,8 @@ class Test_WP_Customize_Custom_CSS_Setting extends WP_UnitTestCase {
 		do_action( 'customize_register', $this->wp_customize );
 		$this->setting = new WP_Customize_Custom_CSS_Setting( $this->wp_customize, 'custom_css[' . get_stylesheet() . ']' );
 		$this->wp_customize->add_setting( $this->setting );
+
+		wp_set_current_user( self::$user_id );
 	}
 
 	/**
