Changeset 50087 for branches/4.8/tests/phpunit/tests/http/functions.php
- Timestamp:
- 01/30/2021 11:13:04 AM (4 years ago)
- Location:
- branches/4.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8
- Property svn:mergeinfo changed
/trunk merged: 43511-43512,46682,46996
- Property svn:mergeinfo changed
-
branches/4.8/tests/phpunit/tests/http/functions.php
r38761 r50087 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 … … 31 35 $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg'; 32 36 $response = wp_remote_head( $url ); 37 38 $this->skipTestOnTimeout( $response ); 33 39 $this->assertEquals( '301', wp_remote_retrieve_response_code( $response ) ); 34 40 } … … 36 42 function test_head_404() { 37 43 $url = 'https://asdftestblog1.files.wordpress.com/2007/09/awefasdfawef.jpg'; 38 $ headers= wp_remote_head( $url );44 $response = wp_remote_head( $url ); 39 45 40 $this->assertEquals( '404', wp_remote_retrieve_response_code( $headers ) ); 46 $this->skipTestOnTimeout( $response ); 47 $this->assertEquals( '404', wp_remote_retrieve_response_code( $response ) ); 41 48 } 42 49 … … 45 52 46 53 $response = wp_remote_get( $url ); 54 55 $this->skipTestOnTimeout( $response ); 56 47 57 $headers = wp_remote_retrieve_headers( $response ); 48 58 … … 60 70 61 71 $response = wp_remote_get( $url ); 72 73 $this->skipTestOnTimeout( $response ); 74 62 75 $headers = wp_remote_retrieve_headers( $response ); 63 76 … … 74 87 // pretend we've already redirected 5 times 75 88 $response = wp_remote_get( $url, array( 'redirection' => -1 ) ); 89 90 $this->skipTestOnTimeout( $response ); 76 91 $this->assertWPError( $response ); 77 92 } … … 84 99 85 100 $response = wp_remote_head( $url ); 86 $cookies = wp_remote_retrieve_cookies( $response ); 101 102 $this->skipTestOnTimeout( $response ); 103 104 $cookies = wp_remote_retrieve_cookies( $response ); 87 105 88 106 $this->assertNotEmpty( $cookies ); … … 114 132 ), 115 133 ) ); 116 $cookies = wp_remote_retrieve_cookies( $response ); 134 135 $this->skipTestOnTimeout( $response ); 136 137 $cookies = wp_remote_retrieve_cookies( $response ); 117 138 118 139 $this->assertNotEmpty( $cookies ); … … 135 156 ), 136 157 ) ); 137 $cookies = wp_remote_retrieve_cookies( $response ); 158 159 $this->skipTestOnTimeout( $response ); 160 161 $cookies = wp_remote_retrieve_cookies( $response ); 138 162 139 163 $this->assertNotEmpty( $cookies );
Note: See TracChangeset
for help on using the changeset viewer.