Ticket #60865: 60865.diff
File 60865.diff, 5.4 KB (added by , 10 months ago) |
---|
-
tests/phpunit/tests/functions/wpRemoteFopen.php
27 27 */ 28 28 public function test_wp_remote_fopen() { 29 29 // This URL gives a direct 200 response. 30 $url = 'https:// asdftestblog1.wordpress.com/wp-content/uploads/2007/09/2007-06-30-dsc_4700-1.jpg';30 $url = 'https://s.w.org/screenshots/3.9/dashboard.png'; 31 31 $response = wp_remote_fopen( $url ); 32 32 33 33 $this->assertIsString( $response ); 34 $this->assertSame( 40148, strlen( $response ) );34 $this->assertSame( 153204, strlen( $response ) ); 35 35 } 36 36 } -
tests/phpunit/tests/http/functions.php
11 11 */ 12 12 public function test_head_request() { 13 13 // This URL gives a direct 200 response. 14 $url = 'https:// asdftestblog1.wordpress.com/wp-content/uploads/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 17 17 $this->skipTestOnTimeout( $response ); … … 20 20 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 } 27 27 … … 30 30 */ 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 36 36 $this->skipTestOnTimeout( $response ); … … 41 41 * @covers ::wp_remote_head 42 42 */ 43 43 public function test_head_404() { 44 $url = 'https:// asdftestblog1.wordpress.com/wp-content/uploads/2007/09/awefasdfawef.jpg';44 $url = 'https://wordpress.org/screenshots/3.9/awefasdfawef.jpg'; 45 45 $response = wp_remote_head( $url ); 46 46 47 47 $this->skipTestOnTimeout( $response ); … … 54 54 * @covers ::wp_remote_retrieve_response_code 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 ); 60 60 … … 65 65 $this->assertIsArray( $response ); 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 } 72 72 … … 76 76 * @covers ::wp_remote_retrieve_response_code 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 ); 83 83 … … 86 86 $headers = wp_remote_retrieve_headers( $response ); 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 } 93 93 … … 95 95 * @covers ::wp_remote_get 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. 102 102 $response = wp_remote_get( $url, array( 'redirection' => -1 ) ); -
tests/phpunit/tests/image/functions.php
638 638 */ 639 639 public function test_wp_crop_image_with_url() { 640 640 $file = wp_crop_image( 641 'https:// asdftestblog1.files.wordpress.com/2008/04/canola.jpg',641 'https://s.w.org/screenshots/3.9/dashboard.png', 642 642 0, 643 643 0, 644 644 100, … … 646 646 100, 647 647 100, 648 648 false, 649 DIR_TESTDATA . '/images/' . __FUNCTION__ . '. jpg'649 DIR_TESTDATA . '/images/' . __FUNCTION__ . '.png' 650 650 ); 651 651 652 652 if ( is_wp_error( $file ) && $file->get_error_code() === 'invalid_image' ) { … … 687 687 */ 688 688 public function test_wp_crop_image_should_fail_with_wp_error_object_if_url_does_not_exist() { 689 689 $file = wp_crop_image( 690 'https:// asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg',690 'https://wordpress.org/screenshots/3.9/canoladoesnotexist.jpg', 691 691 0, 692 692 0, 693 693 100,