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/getIdFromBlogname.php

    r47013 r48937  
    102102            $current_site = $original_network;
    103103
    104             $this->assertEquals( $expected, $result );
     104            $this->assertSame( $expected, $result );
    105105        }
    106106
     
    123123            $current_site = $original_network;
    124124
    125             $this->assertEquals( $expected, $result );
     125            $this->assertSame( $expected, $result );
    126126        }
    127127
     
    135135            $current_site = $original_network;
    136136
    137             $this->assertEquals( null, $result );
     137            $this->assertNull( $result );
    138138        }
    139139
Note: See TracChangeset for help on using the changeset viewer.