Changeset 57993
- Timestamp:
- 04/15/2024 12:22:26 PM (8 months ago)
- Location:
- branches/5.8
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
-
branches/5.8/tests/phpunit/tests/functions/wpRemoteFopen.php
r49006 r57993 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->assertInternalType( 'string', $response ); 33 $this->assertSame( 40148, strlen( $response ) );33 $this->assertSame( 153204, strlen( $response ) ); 34 34 } 35 35 } -
branches/5.8/tests/phpunit/tests/http/functions.php
r50344 r57993 13 13 function test_head_request() { 14 14 // This URL gives a direct 200 response. 15 $url = 'https:// asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';15 $url = 'https://s.w.org/screenshots/3.9/dashboard.png'; 16 16 $response = wp_remote_head( $url ); 17 17 … … 22 22 $this->assertInternalType( 'array', $response ); 23 23 24 $this->assertSame( 'image/ jpeg', $headers['content-type'] );25 $this->assertSame( ' 40148', $headers['content-length'] );24 $this->assertSame( 'image/png', $headers['Content-Type'] ); 25 $this->assertSame( '153204', $headers['Content-Length'] ); 26 26 $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); 27 27 } … … 32 32 function test_head_redirect() { 33 33 // This URL will 301 redirect. 34 $url = 'https:// asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';34 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 35 35 $response = wp_remote_head( $url ); 36 36 … … 42 42 * @covers ::wp_remote_head 43 43 */ 44 function test_head_404() {45 $url = 'https:// asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg';44 public function test_head_404() { 45 $url = 'https://wordpress.org/screenshots/3.9/awefasdfawef.jpg'; 46 46 $response = wp_remote_head( $url ); 47 47 … … 55 55 * @covers ::wp_remote_retrieve_response_code 56 56 */ 57 function test_get_request() {58 $url = 'https:// asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';57 public function test_get_request() { 58 $url = 'https://s.w.org/screenshots/3.9/dashboard.png'; 59 59 60 60 $response = wp_remote_get( $url ); … … 67 67 68 68 // Should return the same headers as a HEAD request. 69 $this->assertSame( 'image/ jpeg', $headers['content-type'] );70 $this->assertSame( ' 40148', $headers['content-length'] );69 $this->assertSame( 'image/png', $headers['Content-Type'] ); 70 $this->assertSame( '153204', $headers['Content-Length'] ); 71 71 $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); 72 72 } … … 78 78 */ 79 79 function test_get_redirect() { 80 // This will redirect to asdftestblog1.files.wordpress.com.81 $url = 'https:// asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';80 // This will redirect to wordpress.org. 81 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 82 82 83 83 $response = wp_remote_get( $url ); … … 88 88 89 89 // Should return the same headers as a HEAD request. 90 $this->assertSame( 'image/ jpeg', $headers['content-type'] );91 $this->assertSame( ' 40148', $headers['content-length'] );90 $this->assertSame( 'image/png', $headers['Content-Type'] ); 91 $this->assertSame( '153204', $headers['Content-Length'] ); 92 92 $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); 93 93 } … … 97 97 */ 98 98 function test_get_redirect_limit_exceeded() { 99 // This will redirect to asdftestblog1.files.wordpress.com.100 $url = 'https:// asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';99 // This will redirect to wordpress.org. 100 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 101 101 102 102 // Pretend we've already redirected 5 times. -
branches/5.8/tests/phpunit/tests/image/functions.php
r50814 r57993 395 395 public function test_wp_crop_image_url() { 396 396 $file = wp_crop_image( 397 'https:// asdftestblog1.files.wordpress.com/2008/04/canola.jpg',397 'https://s.w.org/screenshots/3.9/dashboard.png', 398 398 0, 399 399 0, … … 403 403 100, 404 404 false, 405 DIR_TESTDATA . '/images/' . __FUNCTION__ . '. jpg'405 DIR_TESTDATA . '/images/' . __FUNCTION__ . '.png' 406 406 ); 407 407 … … 438 438 public function test_wp_crop_image_url_not_exist() { 439 439 $file = wp_crop_image( 440 'https:// asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg',440 'https://wordpress.org/screenshots/3.9/canoladoesnotexist.jpg', 441 441 0, 442 442 0,
Note: See TracChangeset
for help on using the changeset viewer.