Make WordPress Core


Ignore:
Timestamp:
04/15/2024 12:30:10 PM (3 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 5.4 branch.

Props peterwilsoncc, jorbin.
See #60865.

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

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

    r47212 r57997  
    2626    public function test_wp_remote_fopen() {
    2727        // This URL gives a direct 200 response.
    28         $url      = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';
     28        $url      = 'https://s.w.org/screenshots/3.9/dashboard.png';
    2929        $response = wp_remote_fopen( $url );
    3030
    31         $this->assertInternalType( 'string', $response );
    32         $this->assertEquals( 40148, strlen( $response ) );
     31        $this->assertIsString( $response );
     32        $this->assertSame( 153204, strlen( $response ) );
    3333    }
    3434}
Note: See TracChangeset for help on using the changeset viewer.