Changeset 58834 for trunk/tests/phpunit/tests/theme/wpThemeJson.php
- Timestamp:
- 07/31/2024 02:39:46 AM (16 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r58797 r58834 4998 4998 * @ticket 61123 4999 4999 * @ticket 61165 5000 * @ticket 61720 5000 5001 */ 5001 5002 public function test_get_top_level_background_image_styles() { … … 5005 5006 'styles' => array( 5006 5007 'background' => array( 5007 'backgroundImage' => array(5008 'backgroundImage' => array( 5008 5009 'url' => 'http://example.org/image.png', 5009 5010 ), 5010 'backgroundSize' => 'contain', 5011 'backgroundRepeat' => 'no-repeat', 5012 'backgroundPosition' => 'center center', 5011 'backgroundSize' => 'contain', 5012 'backgroundRepeat' => 'no-repeat', 5013 'backgroundPosition' => 'center center', 5014 'backgroundAttachment' => 'fixed', 5013 5015 ), 5014 5016 ), … … 5021 5023 ); 5022 5024 5023 $expected_styles = "html{min-height: calc(100% - var(--wp-admin--admin-bar--height, 0px));}:root :where(body){background-image: url('http://example.org/image.png');background-position: center center;background-repeat: no-repeat;background-size: contain; }";5025 $expected_styles = "html{min-height: calc(100% - var(--wp-admin--admin-bar--height, 0px));}:root :where(body){background-image: url('http://example.org/image.png');background-position: center center;background-repeat: no-repeat;background-size: contain;background-attachment: fixed;}"; 5024 5026 $this->assertSame( $expected_styles, $theme_json->get_styles_for_block( $body_node ), 'Styles returned from "::get_stylesheet()" with top-level background styles type do not match expectations' ); 5025 5027 … … 5029 5031 'styles' => array( 5030 5032 'background' => array( 5031 'backgroundImage' => "url('http://example.org/image.png')",5032 'backgroundSize' => 'contain',5033 'backgroundRepeat' => 'no-repeat',5034 'backgroundPosition' => 'center center',5035 ),5036 ),5037 )5038 );5039 5040 $expected_styles = "html{min-height: calc(100% - var(--wp-admin--admin-bar--height, 0px));}:root :where(body){background-image: url('http://example.org/image.png');background-position: center center;background-repeat: no-repeat;background-size: contain;}"; 5033 'backgroundImage' => "url('http://example.org/image.png')", 5034 'backgroundSize' => 'contain', 5035 'backgroundRepeat' => 'no-repeat', 5036 'backgroundPosition' => 'center center', 5037 'backgroundAttachment' => 'fixed', 5038 ), 5039 ), 5040 ) 5041 ); 5042 5041 5043 $this->assertSame( $expected_styles, $theme_json->get_styles_for_block( $body_node ), 'Styles returned from "::get_stylesheet()" with top-level background image as string type do not match expectations' ); 5042 5044 } … … 5044 5046 /** 5045 5047 * @ticket 61588 5048 * @ticket 61720 5046 5049 */ 5047 5050 public function test_get_block_background_image_styles() { … … 5053 5056 'core/group' => array( 5054 5057 'background' => array( 5055 'backgroundImage' => "url('http://example.org/group.png')", 5056 'backgroundSize' => 'cover', 5057 'backgroundRepeat' => 'no-repeat', 5058 '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', 5059 5063 ), 5060 5064 ), … … 5095 5099 ); 5096 5100 5097 $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;}"; 5098 5102 $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' ); 5099 5103 }
Note: See TracChangeset
for help on using the changeset viewer.