WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/09/2020 03:43:14 PM (13 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 [48937], [48939], [48940], [48944].

See #38266.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-controller.php

    r49246 r49547  
    249249        $args       = rest_get_endpoint_args_for_schema( $controller->get_item_schema() );
    250250
    251         $this->assertEquals( 'A pretty string.', $args['somestring']['description'] );
     251        $this->assertSame( 'A pretty string.', $args['somestring']['description'] );
    252252        $this->assertFalse( isset( $args['someinteger']['description'] ) );
    253253    }
Note: See TracChangeset for help on using the changeset viewer.