Make WordPress Core


Ignore:
Timestamp:
04/04/2024 09:10:39 PM (2 years ago)
Author:
jorbin
Message:

Tests: Update expectations in wp_remote_head() and wp_remote_get() tests.

It appears that something has changed on the WP.com side to compress the requested images on the fly, which interfered with the previous expectations in these tests.

This commit uses a direct file URL and updates the expected image size to match the currently returned response.

Follow-up to [139/tests], [31258], [47142].

Reviewed by jorbin.
Merges [57903] to the 6.4 branch.

Props dextorlobo, swissspidy, davidbaumwald, SergeyBiryukov.
See #60865.

Location:
branches/6.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.4

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

    r51331 r57930  
    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://asdftestblog1.wordpress.com/wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg';
    3030                $response = wp_remote_fopen( $url );
    3131
    3232                $this->assertIsString( $response );
    33                 $this->assertSame( 40148, strlen( $response ) );
     33                $this->assertSame( 31325, strlen( $response ) );
    3434        }
    3535}
Note: See TracChangeset for help on using the changeset viewer.