Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test
  • Loading branch information
glendaviesnz committed Jan 25, 2023
commit f0597dcd61e5ed32f77b6befc29987914d27c04b
13 changes: 9 additions & 4 deletions phpunit/class-wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1615,18 +1615,23 @@ public function test_update_separator_declarations() {

}

public function test_get_stylesheet_handles_custom_css() {
public function test_get_custom_css_handles_global_custom_css() {
$theme_json = new WP_Theme_JSON_Gutenberg(
array(
'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA,
'styles' => array(
'css' => 'body { color:purple; }',
'css' => 'body {color:purple;}',
'blocks' => array(
'core/paragraph' => array(
'css' => 'color:red;',
),
),
),
)
);

$custom_css = 'body { color:purple; }';
$this->assertEquals( $custom_css, $theme_json->get_stylesheet( array( 'custom-css' ) ) );
$custom_css = 'body {color:purple;}p{color:red;}';
$this->assertEquals( $custom_css, $theme_json->get_custom_css() );
}

/**
Expand Down