Skip to content

Tests: Use assertNotSame() for scalar comparisons in file tests - #14857

Open
hmbashar wants to merge 1 commit into
WordPress:trunkfrom
hmbashar:64895/file
Open

hmbashar wants to merge 1 commit into
WordPress:trunkfrom
hmbashar:64895/file

Conversation

@hmbashar

Copy link
Copy Markdown

Description

Converts assertNotEquals() to assertNotSame() in tests/phpunit/tests/file.php where values are scalar (strings, URLs, integers, booleans). Follow-up to Trac #64895.

assertNotSame() is stricter — it checks both value and type equality, preventing false passes from type coercion.

Changes

  • tests/phpunit/tests/file.php: Replace assertNotEquals() with assertNotSame() for scalar comparisons

How to test

  1. Run the affected test class: phpunit tests/phpunit/tests/file.php
  2. All tests should pass

See Trac #64895

Use of AI Tools

AI assistance: Yes
Tool(s): Claude
Model(s): claude-sonnet-5-5
Used for: Code implementation and test; reviewed and verified by contributor.

@github-actions

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.

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

Props hmbashar.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

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.

1 participant