Make WordPress Core


Ignore:
Timestamp:
03/07/2023 05:46:16 AM (4 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__columns.html

    r53261 r55471  
    1 <!-- wp:gallery {"linkTo":"none","className":"columns-1"} -->
    2 <figure class="wp-block-gallery has-nested-images is-cropped columns-1" >
    3         <!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
     1<!-- wp:gallery {"columns":1,"linkTo":"none"} -->
     2<figure class="wp-block-gallery has-nested-images columns-1 is-cropped">
     3        <!-- wp:image {"id":1421,"sizeSlug":"large","linkDestination":"none","inheritedAttributes":{"linkDestination":true,"linkTarget":true,"sizeSlug":true}} -->
    44        <figure class="wp-block-image size-large">
    5                 <img src="https://cldup.com/uuUqE_dXzy.jpg" alt="Image gallery image" />
     5                <img
     6                        src="https://sergioestevaofolio.files.wordpress.com/2016/09/cropped-img_9054-1.jpg?w=190"
     7                        alt="Image gallery image"
     8                        class="wp-image-1421"
     9                />
    610        </figure>
    711        <!-- /wp:image -->
    812
    9         <!-- wp:image {"sizeSlug":"large","linkDestination":"none"} -->
     13        <!-- wp:image {"id":1440,"sizeSlug":"large","linkDestination":"none","inheritedAttributes":{"linkDestination":true,"linkTarget":true,"sizeSlug":true}} -->
    1014        <figure class="wp-block-image size-large">
    11                 <img src="http://google.com/hi.png" alt="Image gallery image" />
     15                <img
     16                        src="https://sergioestevaofolio.files.wordpress.com/2017/09/cropped-l1001498-1.jpg?w=580"
     17                        alt="Image gallery image"
     18                        class="wp-image-1440"
     19                />
    1220        </figure>
    1321        <!-- /wp:image -->
Note: See TracChangeset for help on using the changeset viewer.