- Timestamp:
- 01/09/2024 06:10:09 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/block-supports/wpRenderBackgroundSupport.php
r56614 r57254 68 68 * 69 69 * @ticket 59357 70 * @ticket 60175 70 71 * 71 72 * @covers ::wp_render_background_support … … 136 137 ), 137 138 ), 138 'expected_wrapper' => '<div style="background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>',139 'expected_wrapper' => '<div class="has-background" style="background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>', 139 140 'wrapper' => '<div>Content</div>', 140 141 ), 142 'background image style with contain, position, and repeat is applied' => array( 143 'theme_name' => 'block-theme-child-with-fluid-typography', 144 'block_name' => 'test/background-rules-are-output', 145 'background_settings' => array( 146 'backgroundImage' => true, 147 ), 148 'background_style' => array( 149 'backgroundImage' => array( 150 'url' => 'https://example.com/image.jpg', 151 'source' => 'file', 152 ), 153 'backgroundRepeat' => 'no-repeat', 154 'backgroundSize' => 'contain', 155 ), 156 'expected_wrapper' => '<div class="has-background" style="background-image:url('https://example.com/image.jpg');background-position:center;background-repeat:no-repeat;background-size:contain;">Content</div>', 157 'wrapper' => '<div>Content</div>', 158 ), 141 159 'background image style is appended if a style attribute already exists' => array( 142 160 'theme_name' => 'block-theme-child-with-fluid-typography', … … 151 169 ), 152 170 ), 153 'expected_wrapper' => '<div class name="wp-block-test" style="color: red;background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>',154 'wrapper' => '<div class name="wp-block-test" style="color: red">Content</div>',171 'expected_wrapper' => '<div class="wp-block-test has-background" style="color: red;background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>', 172 'wrapper' => '<div class="wp-block-test" style="color: red">Content</div>', 155 173 ), 156 174 'background image style is appended if a style attribute containing multiple styles already exists' => array( … … 166 184 ), 167 185 ), 168 'expected_wrapper' => '<div class name="wp-block-test" style="color: red;font-size: 15px;background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>',169 'wrapper' => '<div class name="wp-block-test" style="color: red;font-size: 15px;">Content</div>',186 'expected_wrapper' => '<div class="wp-block-test has-background" style="color: red;font-size: 15px;background-image:url('https://example.com/image.jpg');background-size:cover;">Content</div>', 187 'wrapper' => '<div class="wp-block-test" style="color: red;font-size: 15px;">Content</div>', 170 188 ), 171 189 'background image style is not applied if the block does not support background image' => array(
Note: See TracChangeset
for help on using the changeset viewer.