Skip to content

Commit 75c1202

Browse files
committed
Fix suggestions
1 parent 3b0e7bf commit 75c1202

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

phpunit/class-wp-theme-json-resolver-test.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public function test_get_user_data_from_wp_global_styles_does_not_use_uncached_q
359359
$this->assertEmpty( $user_cpt, 'User CPT is expected to be empty.' );
360360
}
361361

362-
public function register_block_data( $block_name ) {
362+
private function register_block_data( $block_name ) {
363363
register_block_type(
364364
$block_name,
365365
array(
@@ -451,7 +451,7 @@ static function( $element ) {
451451
return isset( $element['name'] ) && 'my/block-with-styles' === $element['name'];
452452
}
453453
);
454-
$this->assertTrue( count( $block_styles ) === 1, 'block styles must be defined' );
454+
$this->assertTrue( count( $block_styles ) === 1, 'block styles must be present' );
455455
$this->assertFalse( isset( $settings['color']['palette']['theme'] ), 'theme palette is not present' );
456456
$this->assertFalse( isset( $settings['color']['palette']['custom'] ), 'user palette is not present' );
457457

@@ -463,7 +463,7 @@ static function( $element ) {
463463
*/
464464
public function test_get_merged_data_returns_origin_theme() {
465465
// Make sure there is data from the blocks origin.
466-
$this::register_block_data( 'my/block-with-styles' );
466+
$this->register_block_data( 'my/block-with-styles' );
467467

468468
// Make sure there is data from the theme origin.
469469
switch_theme( 'block-theme' );
@@ -474,15 +474,15 @@ public function test_get_merged_data_returns_origin_theme() {
474474
$theme_json = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( 'theme' );
475475
$settings = $theme_json->get_settings();
476476
$styles = $theme_json->get_styles_block_nodes();
477-
$this->assertTrue( isset( $settings['color']['palette']['default'] ), 'core palette must be defined' );
477+
$this->assertTrue( isset( $settings['color']['palette']['default'] ), 'core palette must be present' );
478478
$block_styles = array_filter(
479479
$styles,
480480
static function( $element ) {
481481
return isset( $element['name'] ) && 'my/block-with-styles' === $element['name'];
482482
}
483483
);
484-
$this->assertTrue( count( $block_styles ) === 1, 'block styles are present' );
485-
$this->assertTrue( isset( $settings['color']['palette']['theme'] ), 'theme palette must be defined' );
484+
$this->assertTrue( count( $block_styles ) === 1, 'block styles must be present' );
485+
$this->assertTrue( isset( $settings['color']['palette']['theme'] ), 'theme palette must be present' );
486486
$this->assertFalse( isset( $settings['color']['palette']['custom'] ), 'user palette is not present' );
487487

488488
unregister_block_type( 'my/block-with-styles' );
@@ -504,16 +504,16 @@ public function test_get_merged_data_returns_origin_custom() {
504504
$theme_json = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data();
505505
$settings = $theme_json->get_settings();
506506
$styles = $theme_json->get_styles_block_nodes();
507-
$this->assertTrue( isset( $settings['color']['palette']['default'] ), 'core palette isn\'t defined' );
507+
$this->assertTrue( isset( $settings['color']['palette']['default'] ), 'core palette must be present' );
508508
$block_styles = array_filter(
509509
$styles,
510510
static function( $element ) {
511511
return isset( $element['name'] ) && 'my/block-with-styles' === $element['name'];
512512
}
513513
);
514-
$this->assertTrue( count( $block_styles ) === 1, 'block styles are present' );
515-
$this->assertTrue( isset( $settings['color']['palette']['theme'] ), 'theme palette is present' );
516-
$this->assertTrue( isset( $settings['color']['palette']['custom'] ), 'user palette isn\'t defined' );
514+
$this->assertTrue( count( $block_styles ) === 1, 'block styles must be present' );
515+
$this->assertTrue( isset( $settings['color']['palette']['theme'] ), 'theme palette must be present' );
516+
$this->assertTrue( isset( $settings['color']['palette']['custom'] ), 'user palette must be present' );
517517

518518
unregister_block_type( 'my/block-with-styles' );
519519
}

0 commit comments

Comments
 (0)