Make WordPress Core


Ignore:
Timestamp:
03/07/2023 05:46:16 AM (3 years 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/data/blocks/fixtures/core__gallery.html

    r53261 r55471  
    11<!-- wp:gallery {"linkTo":"none","className":"columns-2"} -->
    2 <figure class="wp-block-gallery has-nested-images columns-default is-cropped columns-2">
    3         <!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
     2<figure
     3        class="wp-block-gallery has-nested-images columns-default is-cropped columns-2"
     4>
     5        <!-- wp:image {"id":1421,"sizeSlug":"large","linkDestination":"none"} -->
    46        <figure class="wp-block-image size-large">
    5                 <img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" />
     7                <img
     8                        src="https://sergioestevaofolio.files.wordpress.com/2016/09/cropped-img_9054-1.jpg?w=190"
     9                        alt="Image gallery image"
     10                        class="wp-image-1421"
     11                />
    612        </figure>
    713        <!-- /wp:image -->
    814
    9         <!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
     15        <!-- wp:image {"id":1440,"sizeSlug":"large","linkDestination":"none"} -->
    1016        <figure class="wp-block-image size-large">
    11                 <img src="http://google.com/hi.png" alt="Image gallery image" />
     17                <img
     18                        src="https://sergioestevaofolio.files.wordpress.com/2017/09/cropped-l1001498-1.jpg?w=580"
     19                        alt="Image gallery image"
     20                        class="wp-image-1440"
     21                />
    1222        </figure>
    1323        <!-- /wp:image -->
Note: See TracChangeset for help on using the changeset viewer.