Make WordPress Core


Ignore:
Timestamp:
04/15/2024 04:53:55 PM (5 weeks 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 4.7 branch.

Props peterwilsoncc, jorbin.
See #60865.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/tests/phpunit/tests/image/functions.php

    r49526 r58006  
    312312        }
    313313
    314         $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canola.jpg',
     314        $file = wp_crop_image( 'https://s.w.org/screenshots/3.9/dashboard.png',
    315315                              0, 0, 100, 100, 100, 100, false,
    316                               DIR_TESTDATA . '/images/' . __FUNCTION__ . '.jpg' );
     316                              DIR_TESTDATA . '/images/' . __FUNCTION__ . '.png' );
    317317        $this->assertNotInstanceOf( 'WP_Error', $file );
    318318        $this->assertFileExists( $file );
     
    336336        }
    337337
    338         $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg',
     338        $file = wp_crop_image( 'https://wordpress.org/screenshots/3.9/canoladoesnotexist.jpg',
    339339                              0, 0, 100, 100, 100, 100 );
    340340        $this->assertInstanceOf( 'WP_Error', $file );
Note: See TracChangeset for help on using the changeset viewer.