diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index f3ed36dce18e57..277a967c208242 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -971,7 +971,7 @@ public function get_settings() { * * @return string The processed CSS. */ - public function process_blocks_custom_css( $css, $selector ) { + protected function process_blocks_custom_css( $css, $selector ) { $processed_css = ''; // Split CSS nested rules. diff --git a/phpunit/class-wp-theme-json-test.php b/phpunit/class-wp-theme-json-test.php index 4aca6ad5c3bf1f..423b8a6ff41546 100644 --- a/phpunit/class-wp-theme-json-test.php +++ b/phpunit/class-wp-theme-json-test.php @@ -2010,8 +2010,10 @@ public function test_process_blocks_custom_css( $input, $expected ) { 'styles' => array(), ) ); + $reflection = new ReflectionMethod( $theme_json, 'process_blocks_custom_css' ); + $reflection->setAccessible( true ); - $this->assertEquals( $expected, $theme_json->process_blocks_custom_css( $input['css'], $input['selector'] ) ); + $this->assertEquals( $expected, $reflection->invoke( $theme_json, $input['css'], $input['selector'] ) ); } /**