Repository navigation
Tests: Add unit tests for get_author_posts_url() - #14406
shail-mehta wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused tests match existing behavior and use the test framework’s cleanup mechanisms, with no unresolved findings.
No open issues 🎉
What changed in this PR
Adds dedicated unit coverage for get_author_posts_url() without changing production code.
Changes:
- Tests query-string and pretty author URLs.
- Checks nicename lookup and explicit nicename handling.
- Verifies
author_linkfilter arguments and its returned URL.
| File | Description |
|---|---|
| tests/phpunit/tests/user/getAuthorPostsUrl.php | Adds author URL tests with a shared author fixture. |
Review effort: Balanced
|
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. |
|
@shail-mehta Thanks for working on this PR |
lancewillett
left a comment
There was a problem hiding this comment.
Reviewed the tests against the implementation and existing coverage, including the unit-tests audit. No blocking findings. The affected classes passed locally in randomized order on single site (3 tests) and multisite (3 tests); PHPCS and current CI pass.
AI review · gpt-6
Checks query-string and pretty author URLs, explicit nicenames, and the author-link filter arguments. Developed in: #14406 Props shailu25, rejaulalomkhan. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64482 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #14406 landed in https://core.trac.wordpress.org/changeset/64482 |
Checks query-string and pretty author URLs, explicit nicenames, and the author-link filter arguments. Developed in: WordPress/wordpress-develop#14406 Props shailu25, rejaulalomkhan. See #65819. Built from https://develop.svn.wordpress.org/trunk@64482 git-svn-id: http://core.svn.wordpress.org/trunk@63632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What
Trac ticket: #65819
Adds unit tests for
get_author_posts_url()intests/phpunit/tests/user/getAuthorPostsUrl.php.Why
get_author_posts_url()currently has no dedicated@coversunit test file.How
Adds
Tests_User_GetAuthorPostsUrlto test returning a query-string author URL without pretty permalinks, returning a pretty author permalink and looking up the author nicename when omitted, and applying theauthor_linkfilter.Testing Instructions
npm run test:php -- --filter Tests_User_GetAuthorPostsUrlUse of AI Tools