Repository navigation
Tests: Add types and docblocks to wpTexturize and wpHtmlSplit tests - #14898
nickchomey wants to merge 1 commit into
Conversation
Adds parameter and return types plus @param/@return docblocks to the tests and data providers in tests/phpunit/tests/formatting/wpTexturize.php and wpHtmlSplit.php, and the whole-posts.php data function. Tests that returned assertSame()'s void result no longer do. No behavior change. Split out of WordPress#12403 at reviewer request so the regex fix can land or be reverted independently. See #63997.
|
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
No active review issues block approval of the test typing and documentation updates.
No open issues 🎉
What changed in this PR
This PR adds types and documentation to WordPress’s text formatting tests, separating the cleanup from the regex fix in #12403. Production formatting behavior and test expectations remain unchanged.
Changes:
- Add parameter and return types, test descriptions, and data-provider docblocks.
- Remove returns of void assertion results while preserving static data providers.
- Add a
get_html_split_regex()coverage annotation to the texturization performance test.
| File | Description |
|---|---|
tests/phpunit/tests/formatting/wpTexturize.php |
Type and document tests and providers; remove assertion-result returns and extend coverage metadata. |
tests/phpunit/tests/formatting/wpHtmlSplit.php |
Type and document tests and providers; remove assertion-result returns. |
tests/phpunit/data/formatting/whole-posts.php |
Add an array return type and return-shape documentation to the shared provider. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
The type declarations match the existing provider data, static providers are preserved, and expected values are unchanged. The affected classes pass before and after the patch on single-site and multisite, including three randomized orders after applying it. PHPCS and current CI pass; Copilot has no findings. Keeping this separate from the regex fix makes the changes independently reviewable.
AI review · gpt-6
Add parameter and return types and document provider array shapes in the `wptexturize()` and `wp_html_split()` tests and their shared whole-post fixture. Remove returns of void assertion results while preserving the existing cases and expected values. Developed in: #14898 Props nickchomey. See #63997. git-svn-id: https://develop.svn.wordpress.org/trunk@65086 602fd350-edb4-49c9-b593-d223f7449a82
Add parameter and return types and document provider array shapes in the `wptexturize()` and `wp_html_split()` tests and their shared whole-post fixture. Remove returns of void assertion results while preserving the existing cases and expected values. Developed in: WordPress/wordpress-develop#14898 Props nickchomey. See #63997. Built from https://develop.svn.wordpress.org/trunk@65086 git-svn-id: http://core.svn.wordpress.org/trunk@64236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
PR #14898 landed in https://core.trac.wordpress.org/changeset/65086 |
Adds parameter and return types plus
@param/@returndocblocks to the tests and data providers intests/phpunit/tests/formatting/wpTexturize.phpandwpHtmlSplit.php, and todata_whole_posts()intests/phpunit/data/formatting/whole-posts.php. Tests that returnedassertSame()'s void result no longer do. There are no behavior changes, and trunk'sstaticdata providers are kept.This was split out of #12403 at @dmsnell's request, so the regex fix there can land or be reverted on its own. The two PRs don't depend on each other. Whichever lands second will conflict on the docblock above
data_whole_posts()inwpTexturize.php, and it's resolved by keeping both sides.Trac ticket: https://core.trac.wordpress.org/ticket/63997
Use of AI Tools
AI assistance: Yes
Tool(s): OpenCode
Model(s): Claude Opus 5.5
Used for: Splitting the type and docblock changes out of #12403 and rebasing them onto trunk. I reviewed the result.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.