WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/10/2021 01:24:24 PM (10 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use assertSame() in some newly introduced 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.

Follow-up to [49904], [49925], [49992], [50012], [50013], [50065], [50075], [50131], [50150], [50157].

See #38266, #52482.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions.php

    r49551 r50284  
    282282            $this->assertSame( null, $callback_value );
    283283        } else {
    284             $this->assertEquals( $value->count(), unserialize( $serialized )->count() );
     284            $this->assertSame( $value->count(), unserialize( $serialized )->count() );
    285285        }
    286286    }
Note: See TracChangeset for help on using the changeset viewer.