Make WordPress Core


Ignore:
Timestamp:
03/07/2023 05:46:16 AM (21 months ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/render.php

    r55457 r55471  
    228228        $expected_html   = self::strip_r( file_get_contents( $server_html_path ) );
    229229
     230        // Convert HTML to be white space insensitive.
     231        $normalized_html = preg_replace( '/(\s+$)/m', '', $normalized_html );
     232        $expected_html   = preg_replace( '/(\s+$)/m', '', $expected_html );
     233
    230234        $this->assertSame(
    231235            $expected_html,
Note: See TracChangeset for help on using the changeset viewer.