Make WordPress Core


Ignore:
Timestamp:
09/25/2026 03:00:14 PM (7 weeks ago)
Author:
lancewillett
Message:

Tests: Use strict assertions across additional test directories.

Replace loose comparisons with strict assertions where the expected types are known. Cast expected database IDs and serialized lengths to strings, and use float expectations for XPath counts.

Correct the expected default idempotent ability annotation to null, matching the API's documented default. Preserve object-value comparisons where distinct instances are expected.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13756

Props haritpanchal.
See #64895.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/http/base.php

    r59729 r63934  
    270270                $this->assertNotWPError( $res );
    271271                $this->assertSame( '', $res['body'] ); // The body should be empty.
    272                 $this->assertEquals( $size, $res['headers']['Content-Length'] );   // Check the headers are returned (and the size is the same).
     272                $this->assertSame( (string) $size, $res['headers']['Content-Length'] );   // Check the headers are returned (and the size is the same).
    273273                $this->assertSame( $size, $filesize ); // Check that the file is written to disk correctly without any extra characters.
    274274                $this->assertStringStartsWith( get_temp_dir(), $res['filename'] ); // Check it's saving within the temp directory.
Note: See TracChangeset for help on using the changeset viewer.