Make WordPress Core

#57855 closed defect (bug) (fixed)

Tests: Reduce usage of assertEquals for 6.3

Reported by: hellofromtonya's profile hellofromTonya Owned by:
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:


Follow-up to:

The assertEquals() test method does not check that the types of the expected and actual values match. This can hide subtle bugs especially when the values are falsey.


  • Switch to using assertSame() when the type of the value in the assertion is important
  • Replace overall usage of assertEquals() with type-strict assertion methods, with the aim of potentially removing its usage altogether

To help ease the effort of backporting tests, changes should also be made upstream in the Gutenberg repository.

Change History (4)

#1 @jorbin
12 months ago

In 56221:

Tests: Use assertSame() in Tests_Comment

See #57855.

#2 @SergeyBiryukov
12 months ago

In 56222:

Coding Standards: Use single quotes for a string in Tests_Comment.

This resolves a WPCS error:

Error: String "1" does not require double quotes; use single quotes instead.

Includes updating a few related comments for clarity.

Follow-up to [56221].

See #57855.

#3 @audrasjb
12 months ago

  • Milestone changed from 6.3 to 6.4

Moving to milestone 6.4 as WP 6.3 RC3 has been released.

#4 @SergeyBiryukov
12 months ago

  • Milestone changed from 6.4 to 6.3
  • Resolution set to fixed
  • Status changed from new to closed

See #58956 for 6.4.

Note: See TracTickets for help on using tickets.