Changes between Initial Version and Version 1 of Ticket #52482, comment 4
- Timestamp:
- 02/10/2021 09:02:59 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #52482, comment 4
initial v1 1 1 If we ignore `assertEqualsWithDelta()` and search specifically for `assertEquals()`, there are currently 653 matches in 128 files. This has gone up a bit since WordPress 5.6: comment:19:ticket:38266 (572 matches in 121 files), so apparently some newly introduced tests use `assertEquals()` instead of `assertSame()`. Some of those were corrected in [49126] and [49547], but more were added in 5.7. 2 2 3 Would it be appropriate to add an automated check for this, or at least recommend using `assertSame()` in the core contributor handbook? I've updated the examples in [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/ Writing PHPUnit Tests] to use `assertSame()`, but perhaps we could also beexplicitly state somewhere that it should be preferred to `assertEquals()` where possible.3 Would it be appropriate to add an automated check for this, or at least recommend using `assertSame()` in the core contributor handbook? I've updated the examples in [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/ Writing PHPUnit Tests] to use `assertSame()`, but perhaps we could also explicitly state somewhere that it should be preferred to `assertEquals()` where possible. 4 4 5 5 Replying to [comment:3 jrf]: