Changeset 50089 for branches/4.6/tests/phpunit/tests/http/functions.php
- Timestamp:
- 01/30/2021 11:45:38 AM (4 years ago)
- Location:
- branches/4.6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6
- Property svn:mergeinfo changed
/trunk merged: 38757,43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.6/tests/phpunit/tests/http/functions.php
r38164 r50089 6 6 */ 7 7 class Tests_HTTP_Functions extends WP_UnitTestCase { 8 8 9 public function setUp() { 9 10 if ( ! extension_loaded( 'openssl' ) ) { … … 18 19 $url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg'; 19 20 $response = wp_remote_head( $url ); 21 22 $this->skipTestOnTimeout( $response ); 23 20 24 $headers = wp_remote_retrieve_headers( $response ); 21 25 … … 38 42 $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg'; 39 43 $response = wp_remote_head( $url ); 44 45 $this->skipTestOnTimeout( $response ); 40 46 $this->assertEquals( '301', wp_remote_retrieve_response_code( $response ) ); 41 47 } … … 43 49 function test_head_404() { 44 50 $url = 'https://asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg'; 45 $ headers= wp_remote_head( $url );51 $response = wp_remote_head( $url ); 46 52 47 $this->assertEquals( '404', wp_remote_retrieve_response_code( $headers ) ); 53 $this->skipTestOnTimeout( $response ); 54 $this->assertEquals( '404', wp_remote_retrieve_response_code( $response ) ); 48 55 } 49 56 … … 52 59 53 60 $response = wp_remote_get( $url ); 61 62 $this->skipTestOnTimeout( $response ); 63 54 64 $headers = wp_remote_retrieve_headers( $response ); 55 65 … … 65 75 66 76 $response = wp_remote_get( $url ); 77 78 $this->skipTestOnTimeout( $response ); 79 67 80 $headers = wp_remote_retrieve_headers( $response ); 68 81 … … 79 92 // pretend we've already redirected 5 times 80 93 $response = wp_remote_get( $url, array( 'redirection' => -1 ) ); 94 95 $this->skipTestOnTimeout( $response ); 81 96 $this->assertWPError( $response ); 82 97 } … … 89 104 90 105 $response = wp_remote_head( $url ); 91 $cookies = wp_remote_retrieve_cookies( $response ); 106 107 $this->skipTestOnTimeout( $response ); 108 109 $cookies = wp_remote_retrieve_cookies( $response ); 92 110 93 111 $this->assertNotEmpty( $cookies ); … … 119 137 ), 120 138 ) ); 121 $cookies = wp_remote_retrieve_cookies( $response ); 139 140 $this->skipTestOnTimeout( $response ); 141 142 $cookies = wp_remote_retrieve_cookies( $response ); 122 143 123 144 $this->assertNotEmpty( $cookies ); … … 140 161 ), 141 162 ) ); 142 $cookies = wp_remote_retrieve_cookies( $response ); 163 164 $this->skipTestOnTimeout( $response ); 165 166 $cookies = wp_remote_retrieve_cookies( $response ); 143 167 144 168 $this->assertNotEmpty( $cookies );
Note: See TracChangeset
for help on using the changeset viewer.