Make WordPress Core


Ignore:
Timestamp:
10/03/2023 08:27:51 AM (22 months ago)
Author:
gziolo
Message:

Tests: Cover Block Hooks integration with a custom block theme

Adds a simplified version of Twenty Twenty-Three theme that helps testing Block Hooks integration. The theme contains:

  • The required index.html template.
  • The optional single.html template used with tests.
  • 3 template parts where two of them reference patterns.
  • 3 patterns referenced in the templates and the template parts.

New tests automatically register 4 custom blocks with the test theme where each of them hooks into another block using all four target relative positions: before, after, firstChild, lastChild.

The tests verify that the block gets hooked into the correct positions when targeting:

  • template
  • template part
  • pattern

Props ockham, costdev.
See #59313, #59383.
Follow-up [56610].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/themeDir.php

    r56629 r56759  
    188188            'Block Theme Post Content Default',
    189189            'Block Theme with defined Typography Fonts',
     190            'Block Theme with Hooked Blocks',
    190191            'Empty `fontFace` in theme.json - no webfonts defined',
    191192            'A theme with the Update URI header',
Note: See TracChangeset for help on using the changeset viewer.