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/term/getTermParentsList.php

    r46586 r48937  
    3535
    3636    public function test_should_return_empty_for_invalid_id() {
    37         $this->assertEquals( '', get_term_parents_list( 99999999, 'wptests_tax' ) );
     37        $this->assertSame( '', get_term_parents_list( 99999999, 'wptests_tax' ) );
    3838    }
    3939
Note: See TracChangeset for help on using the changeset viewer.