Skip to content
Closed
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
Test: add comment and fix lint issues
  • Loading branch information
oandregal committed Feb 28, 2023
commit 43495d097b43798786e2668e24db633ddea5f074
19 changes: 14 additions & 5 deletions tests/phpunit/tests/theme/wpThemeJsonResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,16 @@ static function( $element ) {

}

public function test_get_merged_data_returns_origin_proper(){
/**
* Tests that get_merged_data returns the data merged up to the proper origin
* and that the core values have the proper data.
*
* @ticket 57824
*
* @covers WP_Theme_JSON_Resolver::get_merged_data
*
*/
public function test_get_merged_data_returns_origin_proper() {
// Make sure the theme has a theme.json
// though it doesn't have any data for styles.spacing.padding.
switch_theme( 'block-theme' );
Expand All @@ -858,10 +867,10 @@ public function test_get_merged_data_returns_origin_proper(){
$user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( wp_get_theme(), true );
$config = json_decode( $user_cpt['post_content'], true );
$config['styles']['spacing']['padding'] = array(
'top' => '23px',
'left' => '23px',
'bottom' => '23px',
'right' => '23px',
'top' => '23px',
'left' => '23px',
'bottom' => '23px',
'right' => '23px',
);
$user_cpt['post_content'] = wp_json_encode( $config );
wp_update_post( $user_cpt, true, false );
Expand Down