Changeset 40289
- Timestamp:
- 03/13/2017 10:57:19 PM (8 years ago)
- Location:
- branches/4.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0
- Property svn:mergeinfo changed
/trunk merged: 31258-31259
- Property svn:mergeinfo changed
-
branches/4.0/tests/phpunit/tests/http/functions.php
r25002 r40289 6 6 */ 7 7 class Tests_HTTP_Functions extends WP_UnitTestCase { 8 public function setUp() { 9 if ( ! extension_loaded( 'openssl' ) ) { 10 $this->markTestSkipped( 'Tests_HTTP_Functions requires openssl.' ); 11 } 12 13 parent::setUp(); 14 } 15 8 16 function test_head_request() { 9 17 // this url give a direct 200 response 10 $url = 'http ://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';18 $url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg'; 11 19 $response = wp_remote_head( $url ); 12 20 $headers = wp_remote_retrieve_headers( $response ); … … 20 28 function test_head_redirect() { 21 29 // this url will 301 redirect 22 $url = 'http ://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';30 $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg'; 23 31 $response = wp_remote_head( $url ); 24 32 $this->assertEquals( '301', wp_remote_retrieve_response_code( $response ) ); … … 26 34 27 35 function test_head_404() { 28 $url = 'http ://asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg';36 $url = 'https://asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg'; 29 37 $headers = wp_remote_head( $url ); 30 38 … … 34 42 35 43 function test_get_request() { 36 $url = 'http ://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg';44 $url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg'; 37 45 $file = tempnam('/tmp', 'testfile'); 38 46 … … 52 60 function test_get_redirect() { 53 61 // this will redirect to asdftestblog1.files.wordpress.com 54 $url = 'http ://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';62 $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg'; 55 63 $file = tempnam('/tmp', 'testfile'); 56 64 … … 70 78 function test_get_redirect_limit_exceeded() { 71 79 // this will redirect to asdftestblog1.files.wordpress.com 72 $url = 'http ://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg';80 $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg'; 73 81 $file = tempnam('/tmp', 'testfile'); 74 82 // pretend we've already redirected 5 times -
branches/4.0/tests/phpunit/tests/image/functions.php
r29120 r40289 291 291 $this->markTestSkipped( 'jpeg support unavailable' ); 292 292 293 $file = wp_crop_image( 'http://asdftestblog1.files.wordpress.com/2008/04/canola.jpg', 293 if ( ! extension_loaded( 'openssl' ) ) { 294 $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url() requires openssl.' ); 295 } 296 297 $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canola.jpg', 294 298 0, 0, 100, 100, 100, 100, false, 295 299 DIR_TESTDATA . '/images/' . rand_str() . '.jpg' ); … … 311 315 312 316 public function test_wp_crop_image_url_not_exist() { 313 $file = wp_crop_image( 'http://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg', 317 if ( ! extension_loaded( 'openssl' ) ) { 318 $this->markTestSkipped( 'Tests_Image_Functions::test_wp_crop_image_url_not_exist() requires openssl.' ); 319 } 320 321 $file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg', 314 322 0, 0, 100, 100, 100, 100 ); 315 323 $this->assertInstanceOf( 'WP_Error', $file );
Note: See TracChangeset
for help on using the changeset viewer.