Skip to content

Classic Block: Port PHPUnit coverage for hiding it from the inserter#79434

Merged
tyxla merged 1 commit into
trunkfrom
port/classic-block-inserter-tests
Jun 23, 2026
Merged

Classic Block: Port PHPUnit coverage for hiding it from the inserter#79434
tyxla merged 1 commit into
trunkfrom
port/classic-block-inserter-tests

Conversation

@tyxla

@tyxla tyxla commented Jun 23, 2026

Copy link
Copy Markdown
Member

What

Ports the PHPUnit coverage for wp_declare_classic_block_necessary() from the corresponding Core PR (wordpress-develop#11712) into Gutenberg, so the two stay in sync.

  • Adds 3 tests to WP_Script_Loader_Test covering the default (hidden) behavior, opting in via the wp_classic_block_supports_inserter filter, and the post being passed to the filter.
  • Aligns the function docblock with the @access private tag from Core.

Why

The function shipped in Gutenberg (#77911, #78613) without PHP test coverage, while Core PR WordPress/wordpress-develop#11712 added tests for it. This brings that coverage back so the implementations stay aligned.

No behavior change.

Testing Instructions

npm run test:unit:php:base -- --filter test_wp_declare_classic_block_necessary

All 3 tests should pass.

Use of AI Tools

Opus 4.8

@tyxla tyxla requested a review from spacedmonkey as a code owner June 23, 2026 09:18
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: tyxla <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

…essary

Ports the unit tests added in the corresponding Core PR
(wordpress-develop#11712) into Gutenberg so the two stay in sync, and
aligns the function docblock with the @access private tag from Core.

No behavior change.
@tyxla tyxla force-pushed the port/classic-block-inserter-tests branch from 3173891 to 716a025 Compare June 23, 2026 09:18
@tyxla tyxla requested review from Mamaduka, t-hamano and yuliyan June 23, 2026 09:20
@tyxla tyxla self-assigned this Jun 23, 2026
@tyxla tyxla added [Block] Classic Affects the Classic Editor Block [Type] Enhancement A suggestion for improvement. labels Jun 23, 2026

@Mamaduka Mamaduka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @tyxla!

@tyxla tyxla enabled auto-merge (squash) June 23, 2026 09:35
@tyxla tyxla merged commit 74870c5 into trunk Jun 23, 2026
51 of 55 checks passed
@tyxla tyxla deleted the port/classic-block-inserter-tests branch June 23, 2026 09:51
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Classic Affects the Classic Editor Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants