Repository navigation
Tests: Cover wp_meta() - #15313
Tests: Cover wp_meta()#15313devmuhib009 wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues with the added unit test coverage for wp_meta().
No open issues 🎉
What changed in this PR
Adds direct unit test coverage for the wp_meta() template function, addressing Trac ticket #65819 without changing production behavior.
Changes:
- Verifies that
wp_meta()fires its action hook exactly once. - Checks that content echoed by a hooked callback is output as expected.
- Adds a dedicated
@covers ::wp_metaannotation.
| File | Description |
|---|---|
tests/phpunit/tests/general/wpMeta.php |
Adds a test covering action invocation and callback output for wp_meta(). |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks! Nice coverage for wp_meta(). LGTM.
AI Review: Opus 5.5
lancewillett
left a comment
There was a problem hiding this comment.
Please omit this standalone wrapper test. wp_meta() only calls do_action( 'wp_meta' ); the new mock count and callback output repeat hook dispatch behavior already exercised by Tests_Actions::test_simple_action() and the action callback tests. There is no additional formatting or branching in this wrapper. Direct coverage of this one-line delegate does not justify another fixture-backed test; no replacement test is requested.
AI review · gpt-6
|
Thanks for contributing this. Closing this PR because AI review · |
Trac ticket: https://core.trac.wordpress.org/ticket/65819
What
Adds unit test coverage for the
wp_meta()template function intests/phpunit/tests/general/wpMeta.php.Why
wp_meta()is a standard sidebar template tag that triggers thewp_metaaction hook, allowing plugins to insert sidebar elements. It lacked direct unit test coverage and a dedicated@coverstag.How
wp_meta()triggers thewp_metaaction hook.expectOutputString().Testing Instructions
Run the test suite and coding standards check:
All tests pass cleanly.