Changeset 57992
- Timestamp:
- 04/15/2024 12:21:00 PM (8 months ago)
- Location:
- branches/5.9
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9
-
branches/5.9/tests/phpunit/tests/functions/wpRemoteFopen.php
r51331 r57992 27 27 public function test_wp_remote_fopen() { 28 28 // 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'; 30 30 $response = wp_remote_fopen( $url ); 31 31 32 32 $this->assertIsString( $response ); 33 $this->assertSame( 40148, strlen( $response ) );33 $this->assertSame( 153204, strlen( $response ) ); 34 34 } 35 35 } -
branches/5.9/tests/phpunit/tests/http/functions.php
r52328 r57992 12 12 public function test_head_request() { 13 13 // This URL gives a direct 200 response. 14 $url = 'https:// asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';14 $url = 'https://s.w.org/screenshots/3.9/dashboard.png'; 15 15 $response = wp_remote_head( $url ); 16 16 … … 21 21 $this->assertIsArray( $response ); 22 22 23 $this->assertSame( 'image/ jpeg', $headers['content-type'] );24 $this->assertSame( ' 40148', $headers['content-length'] );23 $this->assertSame( 'image/png', $headers['Content-Type'] ); 24 $this->assertSame( '153204', $headers['Content-Length'] ); 25 25 $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); 26 26 } … … 31 31 public function test_head_redirect() { 32 32 // This URL will 301 redirect. 33 $url = 'https:// asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';33 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 34 34 $response = wp_remote_head( $url ); 35 35 … … 42 42 */ 43 43 public function test_head_404() { 44 $url = 'https:// asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg';44 $url = 'https://wordpress.org/screenshots/3.9/awefasdfawef.jpg'; 45 45 $response = wp_remote_head( $url ); 46 46 … … 55 55 */ 56 56 public function test_get_request() { 57 $url = 'https:// asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';57 $url = 'https://s.w.org/screenshots/3.9/dashboard.png'; 58 58 59 59 $response = wp_remote_get( $url ); … … 66 66 67 67 // Should return the same headers as a HEAD request. 68 $this->assertSame( 'image/ jpeg', $headers['content-type'] );69 $this->assertSame( ' 40148', $headers['content-length'] );68 $this->assertSame( 'image/png', $headers['Content-Type'] ); 69 $this->assertSame( '153204', $headers['Content-Length'] ); 70 70 $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); 71 71 } … … 77 77 */ 78 78 public function test_get_redirect() { 79 // This will redirect to asdftestblog1.files.wordpress.com.80 $url = 'https:// asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';79 // This will redirect to wordpress.org. 80 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 81 81 82 82 $response = wp_remote_get( $url ); … … 87 87 88 88 // Should return the same headers as a HEAD request. 89 $this->assertSame( 'image/ jpeg', $headers['content-type'] );90 $this->assertSame( ' 40148', $headers['content-length'] );89 $this->assertSame( 'image/png', $headers['Content-Type'] ); 90 $this->assertSame( '153204', $headers['Content-Length'] ); 91 91 $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); 92 92 } … … 96 96 */ 97 97 public function test_get_redirect_limit_exceeded() { 98 // This will redirect to asdftestblog1.files.wordpress.com.99 $url = 'https:// asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';98 // This will redirect to wordpress.org. 99 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 100 100 101 101 // Pretend we've already redirected 5 times. -
branches/5.9/tests/phpunit/tests/image/functions.php
r52269 r57992 373 373 public function test_wp_crop_image_url() { 374 374 $file = wp_crop_image( 375 'https:// asdftestblog1.files.wordpress.com/2008/04/canola.jpg',375 'https://s.w.org/screenshots/3.9/dashboard.png', 376 376 0, 377 377 0, … … 381 381 100, 382 382 false, 383 DIR_TESTDATA . '/images/' . __FUNCTION__ . '. jpg'383 DIR_TESTDATA . '/images/' . __FUNCTION__ . '.png' 384 384 ); 385 385 … … 416 416 public function test_wp_crop_image_url_not_exist() { 417 417 $file = wp_crop_image( 418 'https:// asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg',418 'https://wordpress.org/screenshots/3.9/canoladoesnotexist.jpg', 419 419 0, 420 420 0,
Note: See TracChangeset
for help on using the changeset viewer.