Repository navigation
Conversation
…nts Link block. See #66541.
|
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:
|
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks for working on this, @hmbashar! I really appreciate you taking the time to write server-side rendering unit tests for the Post Comments Link block (render_block_core_post_comments_link() and registration). Local PHPUnit suite (11 tests, 13 assertions) and PHPCS/ESLint both pass cleanly.
I left a couple of small notes inline.
AI Review: Gemini 3.8 Flash
…stration test. See #66541.
Adds unit tests for
render_block_core_post_comments_link()andregister_block_core_post_comments_link()insrc/wp-includes/blocks/post-comments-link.php, which were not referenced by any test. No behavior is changed.The new test class
tests/phpunit/tests/blocks/renderPostCommentsLink.php(11 tests) covers:postIdor when the comments of the post are closed.href=without quotes, so the tests compare the output as it is.has-text-align-*,has-link-color, both together, and none for another element.Testing:
vendor/bin/phpunit --filter 'Tests_Blocks_RenderPostCommentsLink::'vendor/bin/phpunit -c tests/phpunit/multisite.xml --filter 'Tests_Blocks_RenderPostCommentsLink::'vendor/bin/phpcs tests/phpunit/tests/blocks/renderPostCommentsLink.phpI also temporarily broke the function (the checks of the post and of the comments, each class, the count, each text, the title,
esc_url()and the render callback) and confirmed that a new test fails for each one.Trac ticket: https://core.trac.wordpress.org/ticket/66541
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Written with AI and manually reviewed by me.
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.