diff --git a/tests/phpunit/tests/theme/wpThemeJson.php b/tests/phpunit/tests/theme/wpThemeJson.php index 68da3285602e7..394f4e8d0bc0b 100644 --- a/tests/phpunit/tests/theme/wpThemeJson.php +++ b/tests/phpunit/tests/theme/wpThemeJson.php @@ -4434,10 +4434,10 @@ public function test_set_spacing_sizes( $spacing_scale, $expected_output ) { 'spacingScale' => $spacing_scale, ), ), - ) + ), + 'default' ); - $theme_json->set_spacing_sizes(); $this->assertSame( $expected_output, _wp_array_get( $theme_json->get_raw_data(), array( 'settings', 'spacing', 'spacingSizes', 'default' ) ) ); } @@ -4720,17 +4720,6 @@ public function test_set_spacing_sizes_when_invalid( $spacing_scale, $expected_o $this->expectException( Exception::class ); $this->expectExceptionMessage( 'Some of the theme.json settings.spacing.spacingScale values are invalid' ); - $theme_json = new WP_Theme_JSON( - array( - 'version' => WP_Theme_JSON::LATEST_SCHEMA, - 'settings' => array( - 'spacing' => array( - 'spacingScale' => $spacing_scale, - ), - ), - ) - ); - // Ensure PHPUnit 10 compatibility. set_error_handler( static function ( $errno, $errstr ) { @@ -4740,7 +4729,17 @@ static function ( $errno, $errstr ) { E_ALL ); - $theme_json->set_spacing_sizes(); + $theme_json = new WP_Theme_JSON( + array( + 'version' => WP_Theme_JSON::LATEST_SCHEMA, + 'settings' => array( + 'spacing' => array( + 'spacingScale' => $spacing_scale, + ), + ), + ), + 'default' + ); restore_error_handler();