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.server.html

    r55282 r55471  
    11
    2 <figure class="wp-block-gallery has-nested-images columns-default is-cropped columns-2 wp-block-gallery-1 is-layout-flex">
    3        
     2<figure
     3        class="wp-block-gallery has-nested-images columns-default is-cropped columns-2 wp-block-gallery-1 is-layout-flex"
     4>
     5
    46        <figure class="wp-block-image size-large">
    5                 <img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" />
     7                <img data-id="1421"
     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>
    7        
    813
    9        
     14
     15
    1016        <figure class="wp-block-image size-large">
    11                 <img src="http://google.com/hi.png" alt="Image gallery image" />
     17                <img data-id="1440"
     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>
    13        
     23
    1424</figure>
    1525
Note: See TracChangeset for help on using the changeset viewer.