Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #53364, comment 2


Ignore:
Timestamp:
10/20/2021 04:08:58 AM (4 years ago)
Author:
costdev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #53364, comment 2

    initial v1  
    3030The returned value is always `bool` rather than `int`. In these cases, the expected value should be changed to a `bool`.
    3131
    32 This can be done directly e.g. `0` becomes `false`, or by conditional if comparing variables, e.g. instead of comparing `$some_int`, compare the result of `$expected = ( 0 === $some_int )`.
     32This can be done directly e.g. `assertTrue()` / `assertFalse()` / `true|false in data providers`.
    3333
    3434This one requires particularly close attention to the methods being tested, their possible return values and the accuracy of the current tests.