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/option/wpLoadAllOptions.php

    r46586 r48937  
    3434
    3535        // Database has not been hit.
    36         $this->assertEquals( $before, $after );
     36        $this->assertSame( $before, $after );
    3737    }
    3838
     
    5151
    5252        // Database has been hit.
    53         $this->assertEquals( $before + 1, $after );
     53        $this->assertSame( $before + 1, $after );
    5454    }
    5555
     
    7777
    7878        // Filter was called.
    79         $this->assertEquals( $this->alloptions, $all_options );
     79        $this->assertSame( $this->alloptions, $all_options );
    8080    }
    8181
Note: See TracChangeset for help on using the changeset viewer.