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/theme/support.php

    r47548 r48937  
    2626        $this->assertTrue( current_theme_supports( 'admin-bar' ) );
    2727
    28         $this->assertEquals(
     28        $this->assertSame(
    2929            array( 0 => array( 'callback' => '__return_false' ) ),
    3030            get_theme_support( 'admin-bar' )
     
    6262        $this->assertTrue( current_theme_supports( 'post-thumbnails', 'post' ) );
    6363        $this->assertFalse( current_theme_supports( 'post-thumbnails', 'book' ) );
    64         $this->assertEquals(
     64        $this->assertSame(
    6565            array( 0 => array( 'post', 'page' ) ),
    6666            get_theme_support( 'post-thumbnails' )
Note: See TracChangeset for help on using the changeset viewer.