Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#57855 closed defect (bug) (fixed)

Tests: Reduce usage of assertEquals for 6.3

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

Description

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.

Tasks:

  • 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
3 years ago

In 56221:

Tests: Use assertSame() in Tests_Comment

See #57855.

#2 @SergeyBiryukov
3 years 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
3 years ago

  • Milestone 6.36.4

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

#4 @SergeyBiryukov
3 years ago

  • Milestone 6.46.3
  • Resolutionfixed
  • Status newclosed

See #58956 for 6.4.

Note: See TracTickets for help on using tickets.