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/multisite/getSpaceAllowed.php

    r46586 r48937  
    4949            delete_site_option( 'blog_upload_space' );
    5050
    51             $this->assertEquals( 100, get_space_allowed() );
     51            $this->assertSame( 100, get_space_allowed() );
    5252        }
    5353
     
    6060            update_site_option( 'blog_upload_space', 200 );
    6161
    62             $this->assertEquals( 200, get_space_allowed() );
     62            $this->assertSame( 200, get_space_allowed() );
    6363        }
    6464
     
    7474            update_site_option( 'blog_upload_space', $network_option );
    7575
    76             $this->assertEquals( $expected, get_space_allowed() );
     76            $this->assertSame( $expected, get_space_allowed() );
    7777        }
    7878
     
    109109            remove_filter( 'get_space_allowed', array( $this, '_filter_space_allowed' ) );
    110110
    111             $this->assertEquals( 999, $space_allowed );
     111            $this->assertSame( 999, $space_allowed );
    112112        }
    113113
Note: See TracChangeset for help on using the changeset viewer.