Make WordPress Core


Ignore:
Timestamp:
04/07/2024 09:45:23 PM (8 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use an image on WordPress.org CDN in external HTTP tests.

Due to some changes on the WP.com side to compress the requested images on the fly, the exact image size in the response could be different between platforms.

This commit aims to make the affected tests more reliable.

Follow-up to [139/tests], [31258], [34568], [47142], [57903], [57904], [57924].

Merges [57931] to the 6.2 branch.

Props peterwilsoncc, jorbin.
See #60865.

Location:
branches/6.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.2

  • branches/6.2/tests/phpunit/tests/functions/wpRemoteFopen.php

    r51331 r57940  
    2727    public function test_wp_remote_fopen() {
    2828        // This URL gives a direct 200 response.
    29         $url      = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
     29        $url      = 'https://s.w.org/screenshots/3.9/dashboard.png';
    3030        $response = wp_remote_fopen( $url );
    3131
    3232        $this->assertIsString( $response );
    33         $this->assertSame( 40148, strlen( $response ) );
     33        $this->assertSame( 153204, strlen( $response ) );
    3434    }
    3535}
Note: See TracChangeset for help on using the changeset viewer.