Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed Jan 19, 2023
1 parent db2c12b commit d218090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ public function get_settings() {
*
* @return string The processed CSS.
*/
public function process_blocks_custom_css_nested_styles( $css, $selector ) {
public function process_blocks_custom_css( $css, $selector ) {
$processed_css = '';

// Split CSS nested rules.
Expand Down Expand Up @@ -1092,7 +1092,7 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets'
$custom_block_css = _wp_array_get( $this->theme_json, array( 'styles', 'blocks', $name, 'css' ) );
if ( $custom_block_css ) {
$selector = static::$blocks_metadata[ $name ]['selector'];
$stylesheet .= $this->process_blocks_custom_css_nested_styles( $custom_block_css, $selector );
$stylesheet .= $this->process_blocks_custom_css( $custom_block_css, $selector );
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions phpunit/class-wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1699,28 +1699,28 @@ public function data_custom_css_for_user_caps() {
}

/**
* @dataProvider data_process_blocks_custom_css_nested_styles
* @dataProvider data_process_blocks_custom_css
*
* @param array $input An array containing the selector and css to test.
* @param string $expected Expected results.
*/
public function test_process_blocks_custom_css_nested_styles( $input, $expected ) {
public function test_process_blocks_custom_css( $input, $expected ) {
$theme_json = new WP_Theme_JSON_Gutenberg(
array(
'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA,
'styles' => array(),
)
);

$this->assertEquals( $expected, $theme_json->process_blocks_custom_css_nested_styles( $input['css'], $input['selector'] ) );
$this->assertEquals( $expected, $theme_json->process_blocks_custom_css( $input['css'], $input['selector'] ) );
}

/**
* Data provider.
*
* @return array[]
*/
public function data_process_blocks_custom_css_nested_styles() {
public function data_process_blocks_custom_css() {
return array(
// Simple CSS without any child selectors.
'no child selectors' => array(
Expand Down

0 comments on commit d218090

Please sign in to comment.