mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-03 16:50:13 +00:00
Build/Tests Tools: Add unit tests for Gallery blocks.
Introduces unit tests for the following blocks * Gallery block with caption * Gallery block, deprecations 1 thru 7 Updates the unit tests for the following blocks to match the counterparts stored in the Gutenberg repository: * Gallery block * Gallery block with columns Modifies `Tests_Blocks_Render::test_do_block_output()` to ignore white space at the end of lines to account for whitespace equivalence in HTML. Props peterwilsoncc, isabel_brison, gziolo. Fixes #55571. git-svn-id: https://develop.svn.wordpress.org/trunk@55471 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -227,6 +227,10 @@ class Tests_Blocks_Render extends WP_UnitTestCase {
|
||||
$normalized_html = preg_replace( '/wp-block-gallery-\d+/', 'wp-block-gallery-1', $normalized_html );
|
||||
$expected_html = self::strip_r( file_get_contents( $server_html_path ) );
|
||||
|
||||
// Convert HTML to be white space insensitive.
|
||||
$normalized_html = preg_replace( '/(\s+$)/m', '', $normalized_html );
|
||||
$expected_html = preg_replace( '/(\s+$)/m', '', $expected_html );
|
||||
|
||||
$this->assertSame(
|
||||
$expected_html,
|
||||
$normalized_html,
|
||||
|
||||
Reference in New Issue
Block a user