Skip to content

Commit 1b3e85a

Browse files
committed
refactor: update block styles retrieval method to use get_registered_styles_for_block
1 parent fb5c30f commit 1b3e85a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/php/Test_Block_Styles.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function_exists( '{{theme_slug|snakeCase}}_register_block_styles' ),
3333
public function test_button_styles_registered() {
3434
try {
3535
$registry = WP_Block_Styles_Registry::get_instance();
36-
$button_styles = $registry->get_registered_styles( 'core/button' );
36+
$button_styles = $registry->get_registered_styles_for_block( 'core/button' );
3737

3838
$this->assertNotEmpty( $button_styles, 'Button block should have styles' );
3939

@@ -51,7 +51,7 @@ public function test_button_styles_registered() {
5151
public function test_quote_styles_registered() {
5252
try {
5353
$registry = WP_Block_Styles_Registry::get_instance();
54-
$quote_styles = $registry->get_registered_styles( 'core/quote' );
54+
$quote_styles = $registry->get_registered_styles_for_block( 'core/quote' );
5555

5656
$this->assertNotEmpty( $quote_styles, 'Quote block should have styles' );
5757

@@ -68,7 +68,7 @@ public function test_quote_styles_registered() {
6868
public function test_group_styles_registered() {
6969
try {
7070
$registry = WP_Block_Styles_Registry::get_instance();
71-
$group_styles = $registry->get_registered_styles( 'core/group' );
71+
$group_styles = $registry->get_registered_styles_for_block( 'core/group' );
7272

7373
$this->assertNotEmpty( $group_styles, 'Group block should have styles' );
7474

@@ -86,7 +86,7 @@ public function test_group_styles_registered() {
8686
public function test_image_styles_registered() {
8787
try {
8888
$registry = WP_Block_Styles_Registry::get_instance();
89-
$image_styles = $registry->get_registered_styles( 'core/image' );
89+
$image_styles = $registry->get_registered_styles_for_block( 'core/image' );
9090

9191
$this->assertNotEmpty( $image_styles, 'Image block should have styles' );
9292

@@ -103,7 +103,7 @@ public function test_image_styles_registered() {
103103
public function test_post_title_styles_registered() {
104104
try {
105105
$registry = WP_Block_Styles_Registry::get_instance();
106-
$post_title_styles = $registry->get_registered_styles( 'core/post-title' );
106+
$post_title_styles = $registry->get_registered_styles_for_block( 'core/post-title' );
107107

108108
$this->assertNotEmpty( $post_title_styles, 'Post title block should have styles' );
109109

@@ -123,7 +123,7 @@ public function test_all_styles_have_labels() {
123123
$blocks = [ 'core/button', 'core/quote', 'core/group', 'core/image', 'core/post-title' ];
124124

125125
foreach ( $blocks as $block ) {
126-
$styles = $registry->get_registered_styles( $block );
126+
$styles = $registry->get_registered_styles_for_block( $block );
127127

128128
foreach ( $styles as $style ) {
129129
$this->assertNotEmpty(

0 commit comments

Comments
 (0)