@@ -359,7 +359,7 @@ public function test_get_user_data_from_wp_global_styles_does_not_use_uncached_q
359
359
$ this ->assertEmpty ( $ user_cpt , 'User CPT is expected to be empty. ' );
360
360
}
361
361
362
- public function register_block_data ( $ block_name ) {
362
+ private function register_block_data ( $ block_name ) {
363
363
register_block_type (
364
364
$ block_name ,
365
365
array (
@@ -451,7 +451,7 @@ static function( $element ) {
451
451
return isset ( $ element ['name ' ] ) && 'my/block-with-styles ' === $ element ['name ' ];
452
452
}
453
453
);
454
- $ this ->assertTrue ( count ( $ block_styles ) === 1 , 'block styles must be defined ' );
454
+ $ this ->assertTrue ( count ( $ block_styles ) === 1 , 'block styles must be present ' );
455
455
$ this ->assertFalse ( isset ( $ settings ['color ' ]['palette ' ]['theme ' ] ), 'theme palette is not present ' );
456
456
$ this ->assertFalse ( isset ( $ settings ['color ' ]['palette ' ]['custom ' ] ), 'user palette is not present ' );
457
457
@@ -463,7 +463,7 @@ static function( $element ) {
463
463
*/
464
464
public function test_get_merged_data_returns_origin_theme () {
465
465
// 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 ' );
467
467
468
468
// Make sure there is data from the theme origin.
469
469
switch_theme ( 'block-theme ' );
@@ -474,15 +474,15 @@ public function test_get_merged_data_returns_origin_theme() {
474
474
$ theme_json = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data ( 'theme ' );
475
475
$ settings = $ theme_json ->get_settings ();
476
476
$ 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 ' );
478
478
$ block_styles = array_filter (
479
479
$ styles ,
480
480
static function ( $ element ) {
481
481
return isset ( $ element ['name ' ] ) && 'my/block-with-styles ' === $ element ['name ' ];
482
482
}
483
483
);
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 ' );
486
486
$ this ->assertFalse ( isset ( $ settings ['color ' ]['palette ' ]['custom ' ] ), 'user palette is not present ' );
487
487
488
488
unregister_block_type ( 'my/block-with-styles ' );
@@ -504,16 +504,16 @@ public function test_get_merged_data_returns_origin_custom() {
504
504
$ theme_json = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data ();
505
505
$ settings = $ theme_json ->get_settings ();
506
506
$ 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 ' );
508
508
$ block_styles = array_filter (
509
509
$ styles ,
510
510
static function ( $ element ) {
511
511
return isset ( $ element ['name ' ] ) && 'my/block-with-styles ' === $ element ['name ' ];
512
512
}
513
513
);
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 ' );
517
517
518
518
unregister_block_type ( 'my/block-with-styles ' );
519
519
}
0 commit comments