Make WordPress Core


Ignore:
Timestamp:
09/02/2020 12:35:36 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: First pass at using assertSame() instead of assertEquals() in most of the unit 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.

Props johnbillion, jrf, SergeyBiryukov.
See #38266.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/wpGetSites.php

    r47013 r48937  
    7373            $missing_keys = array_diff_key( array_flip( $keys ), $sites[0] );
    7474
    75             $this->assertEquals( array(), $missing_keys, 'Keys are missing from site arrays.' );
     75            $this->assertSame( array(), $missing_keys, 'Keys are missing from site arrays.' );
    7676        }
    7777
Note: See TracChangeset for help on using the changeset viewer.