Skip to content

Build/Test Tools: Ensure strict assertion in comment dir - #13601

Open
3kori wants to merge 2 commits into
WordPress:trunkfrom
3kori:test/64895-change-assertions-in-comment-redo
Open

3kori wants to merge 2 commits into
WordPress:trunkfrom
3kori:test/64895-change-assertions-in-comment-redo

Conversation

@3kori

@3kori 3kori commented Sep 18, 2026

Copy link
Copy Markdown
  • In comment/commentsTemplate.php
    Changed assertEquals to assertSame because the expected and actual values produce identical arrays.

  • In comment/pingback.php
    Tests_Comment_Pingback::test_pingback - Changed assertEquals to assertSame because the expected and actual values produce identical arrays.

    Tests_Comment_Pingback::test_pingback_no_ping_back & Tests_Comment_Pingback::test_pingback_error_response - Changed assertEquals to assertSame because the expected and actual values produce empty arrays.

  • In comment/query.php
    Test_Comment_Query::test_get_comments_for_post - Changed assertEquals to assertSame and cast the expected value ($post_id) from an integer to a string because the WP_Comment::comment_post_ID is a numeric string.

    Test_Comment_Query::test_orderby_meta - Changed assertEquals to assertSame and cast the expected value ($comment_id) from an integer to a string because the WP_Comment::comment_ID is a numeric string.

    Test_Comment_Query::test_get_comments_by_user - Changed assertEquals to assertSame and cast the expected value ($users) from an integer to a string because the WP_Comment::user_id is a numeric string.

    Test_Comment_Query::test_orderby_date_modified_gmt_should_order_by_comment_ID_in_case_of_tie_ASC and Test_Comment_Query::test_orderby_date_modified_gmt_should_order_by_comment_ID_in_case_of_tie_DESC - Changed assertEquals to assertSame and cast the expected array value ($comments) from an integer to a string because the WP_Comment::comment_ID is a numeric string.

    Test_Comment_Query::test_comment_query_object - Kept assertEquals because the expected and actual output give different object instances but the same values.

Trac ticket: #64895

Use of AI Tools

N/A

Note

This is a redo of #13593 because of mishaps on my end.


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.

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props r1k0, mukesh27.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants