Make WordPress Core


Ignore:
Timestamp:
06/07/2021 11:16:29 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in some newly introduced tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using assertSame() should generally be preferred to assertEquals() where appropriate, to make the tests more reliable.

Follow-up to [50380], [50959], [50960], [50973], [50993], [51003], [51051], [51054].

See #52482.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/bookmark/getBookmark.php

    r50936 r51079  
    229229
    230230        /*
    231          * For non-array output type, use assetEquals. Why? The object pulled from cache will have the same
    232          * property values but will be a different object than the expected object.
     231         * For non-array output type, use assertEquals(). Why? The object pulled from the cache
     232         * will have the same property values but will be a different object than the expected object.
    233233         */
    234234        if ( is_object( $expected ) ) {
     
    287287
    288288        /*
    289          * For non-array output type, use assetEquals. Why? The object pulled from the database will have the same
    290          * property values but will be a different object than the expected object.
     289         * For non-array output type, use assertEquals(). Why? The object pulled from the database
     290         * will have the same property values but will be a different object than the expected object.
    291291         */
    292292        if ( is_object( $expected ) ) {
Note: See TracChangeset for help on using the changeset viewer.