Changeset 53157 for trunk/tests/phpunit/tests/blocks/render.php
- Timestamp:
- 04/12/2022 03:10:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/blocks/render.php
r52010 r53157 220 220 } 221 221 222 $html = do_blocks( self::strip_r( file_get_contents( $html_path ) ) ); 223 $expected_html = self::strip_r( file_get_contents( $server_html_path ) ); 222 $html = do_blocks( self::strip_r( file_get_contents( $html_path ) ) ); 223 // If blocks opt into Gutenberg's layout implementation 224 // the container will receive an added classname of `wp_unique_id( 'wp-container-' )` 225 // so we need to normalize the random id. 226 $normalized_html = preg_replace( '/wp-container-\d+/', 'wp-container-1', $html ); 227 228 // The gallery block uses a unique class name of `wp_unique_id( 'wp-block-gallery-' )` 229 // so we need to normalize the random id. 230 $normalized_html = preg_replace( '/wp-block-gallery-\d+/', 'wp-block-gallery-1', $normalized_html ); 231 $expected_html = self::strip_r( file_get_contents( $server_html_path ) ); 224 232 225 233 $this->assertSame( 226 234 $expected_html, 227 $ html,235 $normalized_html, 228 236 "File '$html_path' does not match expected value" 229 237 );
Note: See TracChangeset
for help on using the changeset viewer.