Skip to content

Commit 1e4861a

Browse files
committed
Add block style tests
1 parent 1ea4884 commit 1e4861a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/phpunit/tests/theme/wpThemeJson.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5045,6 +5045,7 @@ public function test_get_top_level_background_image_styles() {
50455045

50465046
/**
50475047
* @ticket 61588
5048+
* @ticket 61720
50485049
*/
50495050
public function test_get_block_background_image_styles() {
50505051
$theme_json = new WP_Theme_JSON(
@@ -5054,10 +5055,11 @@ public function test_get_block_background_image_styles() {
50545055
'blocks' => array(
50555056
'core/group' => array(
50565057
'background' => array(
5057-
'backgroundImage' => "url('http://example.org/group.png')",
5058-
'backgroundSize' => 'cover',
5059-
'backgroundRepeat' => 'no-repeat',
5060-
'backgroundPosition' => 'center center',
5058+
'backgroundImage' => "url('http://example.org/group.png')",
5059+
'backgroundSize' => 'cover',
5060+
'backgroundRepeat' => 'no-repeat',
5061+
'backgroundPosition' => 'center center',
5062+
'backgroundAttachment' => 'fixed',
50615063
),
50625064
),
50635065
'core/quote' => array(
@@ -5096,7 +5098,7 @@ public function test_get_block_background_image_styles() {
50965098
),
50975099
);
50985100

5099-
$group_styles = ":root :where(.wp-block-group){background-image: url('http://example.org/group.png');background-position: center center;background-repeat: no-repeat;background-size: cover;}";
5101+
$group_styles = ":root :where(.wp-block-group){background-image: url('http://example.org/group.png');background-position: center center;background-repeat: no-repeat;background-size: cover;background-attachment: fixed;}";
51005102
$this->assertSame( $group_styles, $theme_json->get_styles_for_block( $group_node ), 'Styles returned from "::get_styles_for_block()" with block-level background styles as string type do not match expectations' );
51015103
}
51025104

0 commit comments

Comments
 (0)