Skip to content

Tests: Add missing @covers tags for blocks, oembed, and rewrite tests#11532

Open
sagarsdeshmukh wants to merge 1 commit intoWordPress:trunkfrom
sagarsdeshmukh:add-covers-blocks-oembed-rewrite
Open

Tests: Add missing @covers tags for blocks, oembed, and rewrite tests#11532
sagarsdeshmukh wants to merge 1 commit intoWordPress:trunkfrom
sagarsdeshmukh:add-covers-blocks-oembed-rewrite

Conversation

@sagarsdeshmukh
Copy link
Copy Markdown

@sagarsdeshmukh sagarsdeshmukh commented Apr 9, 2026

What

Adds missing @covers annotations to 10 test classes across the blocks, oembed, and rewrite groups, as part of the ongoing effort in #64225.

blocks/

File Annotation added
render.php @covers ::do_blocks
renderReusable.php @covers WP_Block
wpBlockParser.php @covers WP_Block_Parser
wpBlockList.php @covers WP_Block_List
registerBlockTypeFromMetadataWithRegistry.php @covers ::register_block_type_from_metadata

oembed/

File Annotation added
wpOembed.php @covers WP_oEmbed
WpEmbed.php @covers WP_Embed
postEmbedUrl.php @covers ::get_post_embed_url

rewrite/

File Annotation added
permastructs.php @covers ::add_permastruct, @covers ::remove_permastruct
numericSlugs.php @covers ::url_to_postid

Why

Without @covers, PHPUnit cannot correctly attribute code coverage to the functions and classes under test. This leads to inaccurate coverage reports on Codecov, where a function may appear uncovered even when dedicated tests exist for it.

Testing

Ran all 10 affected test classes locally:

npm run test:php -- --filter 
"Tests_Blocks_Render|Tests_Blocks_RenderReusable|Tests_Blocks_wpBlockParser| 
Tests_Blocks_wpBlockList|Tests_Blocks_RegisterBlockTypeFromMetadataWithRegistry| 
Tests_WP_oEmbed|Tests_WP_Embed|Tests_Post_Embed_URL|
Tests_Rewrite_Permastructs|Tests_Rewrite_NumericSlugs"

OK (234 tests, 330 assertions) 

Trac

Follow-up to [62213], [62218], [62222].

Fixes https://core.trac.wordpress.org/ticket/64225

Follow-up to [62213], [62218], [62222].

See #64225.
@sagarsdeshmukh sagarsdeshmukh changed the title Tests: Add missing @covers tags for blocks, oembed, and rewrite tests. Tests: Add missing @covers tags for blocks, oembed, and rewrite tests Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props sagardeshmukh.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant