Repository navigation
Tests: Add unit test coverage for the_modified_author() - #14456
rejaulalomkhan wants to merge 1 commit into
Conversation
Adds comprehensive PHPUnit tests covering display of the last editor's display name, author as last editor, missing _edit_last meta fallback, non-existent user fallback, missing global post fallback, the the_modified_author filter hook, and custom display names via data provider. See #65819.
|
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 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. |
There was a problem hiding this comment.
🟢 Approval recommended
The tests match existing behavior and test isolation mechanisms, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Adds unit coverage for the_modified_author() without changing production behavior.
Changes:
- Tests editor and author display names, missing metadata, nonexistent users, and absent global posts.
- Verifies filter customization and varied display names.
| File | Description |
|---|---|
| tests/phpunit/tests/user/theModifiedAuthor.php | Adds fixtures and output assertions for ten test cases. |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
The literal output checks distinguish the editor from the original author and cover filtered output and display names. Optional cleanup: trim wrapper cases already covered by get_the_modified_author() while retaining the exact-output and escaping-sensitive cases.
Unit-tests audit and Copilot review found no blockers. PHPCS passed. Each class passed separately, and the combined batch passed randomized single-site and multisite runs: 63 tests, 95 assertions each (seeds 65829 and 65830). CI is green on the reviewed commit.
AI review · gpt-6
Verify echoed editor names, missing editor or post context, display-name handling, and filtered output. Developed in: #14456 Props rejaulalomkhan. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64548 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #14456 landed in https://core.trac.wordpress.org/changeset/64548 |
Verify echoed editor names, missing editor or post context, display-name handling, and filtered output. Developed in: WordPress/wordpress-develop#14456 Props rejaulalomkhan. See #65819. Built from https://develop.svn.wordpress.org/trunk@64548 git-svn-id: http://core.svn.wordpress.org/trunk@63698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds unit test coverage for
the_modified_author()insrc/wp-includes/author-template.php.Test scenarios covered:
_edit_last._edit_lastpost meta._edit_lastpoints to a non-existent or deleted user ID.$postexists.the_modified_authorfilter hook.@dataProvider.Verification:
OK (10 tests, 10 assertions)OK (10 tests, 10 assertions)OK (10 tests, 10 assertions)OK (5 tests, 9 assertions)0 errors, 0 warnings)Trac ticket: https://core.trac.wordpress.org/ticket/65819
Use of AI Tools: Antigravity (Gemini 2.5) was used to assist in test case ideation, code scaffolding, and formatting to WordPress core standards. All assertions and test outcomes were verified locally through PHPUnit and PHPCS.