Make WordPress Core


Ignore:
Timestamp:
09/02/2020 12:35:36 AM (17 months 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/wpInstallDefaults.php

    r47012 r48937  
    7777            wp_delete_site( $blog_id );
    7878
    79             $this->assertEquals( 'Some page content', $first_page->post_content );
    80             $this->assertEquals( 'Some comment content', $first_comment[0]->comment_content );
     79            $this->assertSame( 'Some page content', $first_page->post_content );
     80            $this->assertSame( 'Some comment content', $first_comment[0]->comment_content );
    8181        }
    8282    }
Note: See TracChangeset for help on using the changeset viewer.