Make WordPress Core

Changeset 57676


Ignore:
Timestamp:
02/21/2024 10:47:49 AM (2 months ago)
Author:
Bernhard Reiter
Message:

Block Hooks: Make test a bit easier to read.

Follow-up [57668].
Props gziolo.
See #60580.

File:
1 edited

Legend:

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

    r57668 r57676  
    164164
    165165        $filter = function ( $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block ) {
    166             if ( 'tests/anchor-block' === $parsed_anchor_block['blockName'] && 'after' === $relative_position ) {
     166            if (
     167                'tests/hooked-block-suppressed-by-filter' === $hooked_block_type &&
     168                'after' === $relative_position &&
     169                'tests/anchor-block' === $parsed_anchor_block['blockName']
     170            ) {
    167171                return null;
    168172            }
     
    171175        };
    172176
    173         add_filter( 'hooked_block_tests/hooked-block-suppressed-by-filter', $filter, 10, 4 );
     177        add_filter( 'hooked_block', $filter, 10, 4 );
    174178        set_ignored_hooked_blocks_metadata( $anchor_block, 'after', $hooked_blocks, null );
    175         remove_filter( 'hooked_block_tests/hooked-block-suppressed-by-filter', $filter );
     179        remove_filter( 'hooked_block', $filter );
    176180
    177181        $this->assertSame( array( 'tests/hooked-block' ), $anchor_block['attrs']['metadata']['ignoredHookedBlocks'] );
Note: See TracChangeset for help on using the changeset viewer.