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:
Peter Wilson
2023-03-07 05:46:16 +00:00
parent 260a34646b
commit 4d3627fd2e
51 changed files with 1407 additions and 77 deletions

View File

@@ -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,