Make WordPress Core

Changeset 56701

Timestamp:
09/26/2023 08:07:07 AM (11 months ago)
Author:
gziolo
Message:

Blocks: Add more unit test covering edge cases for Block Hooks

These two new unit tests document how Block Hooks behave with first_child and last_child relative positions. The hooked blocks will only get inserted in the case where the parent block has at least one child block present. While it seems like a limitation, in practice, it's hard to think of a case where the template would use a parent block without its children. It's more likely to happen with patterns in general, but in the case of patterns wired with the block theme, it also seems unlikely. The reasoning here is that out of the box, the block theme should produce a fully functional and valid HTML.

Props ockham.
See #59313.
Follow-up [56649].

File:
1 edited

Legend:

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

    r56649 r56701  
    236236        $this->assertSame( $original, $actual );
    237237    }
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
    238274}
Note: See TracChangeset for help on using the changeset viewer.