WordPress.org

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/admin/includesTheme.php

    r47122 r48937  
    9696            get_page_templates( null, 'post' )
    9797        );
    98         $this->assertEquals( array(), get_page_templates( null, 'bar' ) );
     98        $this->assertSame( array(), get_page_templates( null, 'bar' ) );
    9999    }
    100100
     
    167167        );
    168168
    169         $this->assertEquals( array(), get_page_templates( null, 'bar' ) );
     169        $this->assertSame( array(), get_page_templates( null, 'bar' ) );
    170170    }
    171171
Note: See TracChangeset for help on using the changeset viewer.