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

    r47878 r48937  
    253253        );
    254254        $this->go_to( '/child-page-1' );
    255         $this->assertEquals( 'wp', redirect_guess_404_permalink() );
     255        $this->assertSame( 'wp', redirect_guess_404_permalink() );
    256256    }
    257257
     
    269269
    270270        // Test default 'non-strict' redirect guess.
    271         $this->assertEquals( get_permalink( $post ), redirect_guess_404_permalink() );
     271        $this->assertSame( get_permalink( $post ), redirect_guess_404_permalink() );
    272272
    273273        // Test 'strict' redirect guess.
Note: See TracChangeset for help on using the changeset viewer.