Changeset 59729 for trunk/tests/phpunit/tests/http/functions.php
- Timestamp:
- 01/29/2025 06:17:34 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/http/functions.php
r58108 r59729 13 13 // This URL gives a direct 200 response. 14 14 $url = 'https://s.w.org/screenshots/3.9/dashboard.png'; 15 $response = wp_remote_head( $url ); 16 17 $this->skipTestOnTimeout( $response ); 15 $response = $this->wp_remote_head( $url ); 16 18 17 $this->assertNotWPError( $response ); 19 18 … … 32 31 // This URL will 301 redirect. 33 32 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 34 $response = wp_remote_head( $url ); 35 36 $this->skipTestOnTimeout( $response ); 33 $response = $this->wp_remote_head( $url ); 34 37 35 $this->assertNotWPError( $response ); 38 36 $this->assertSame( 301, wp_remote_retrieve_response_code( $response ) ); … … 44 42 public function test_head_404() { 45 43 $url = 'https://wordpress.org/screenshots/3.9/awefasdfawef.jpg'; 46 $response = wp_remote_head( $url ); 47 48 $this->skipTestOnTimeout( $response ); 44 $response = $this->wp_remote_head( $url ); 45 49 46 $this->assertNotWPError( $response ); 50 47 $this->assertSame( 404, wp_remote_retrieve_response_code( $response ) ); … … 59 56 $url = 'https://s.w.org/screenshots/3.9/dashboard.png'; 60 57 61 $response = wp_remote_get( $url ); 62 63 $this->skipTestOnTimeout( $response ); 58 $response = $this->wp_remote_get( $url ); 59 64 60 $this->assertNotWPError( $response ); 65 61 … … 81 77 $url = 'https://wp.org/screenshots/3.9/dashboard.png'; 82 78 83 $response = wp_remote_get( $url ); 84 85 $this->skipTestOnTimeout( $response ); 79 $response = $this->wp_remote_get( $url ); 80 86 81 $this->assertNotWPError( $response ); 87 82 … … 102 97 103 98 // Pretend we've already redirected 5 times. 104 $response = wp_remote_get( $url, array( 'redirection' => -1 ) ); 105 106 $this->skipTestOnTimeout( $response ); 99 $response = $this->wp_remote_get( $url, array( 'redirection' => -1 ) ); 100 107 101 $this->assertWPError( $response ); 108 102 } … … 119 113 $url = 'https://login.wordpress.org/wp-login.php'; 120 114 121 $response = wp_remote_head( $url ); 122 123 $this->skipTestOnTimeout( $response ); 115 $response = $this->wp_remote_head( $url ); 116 124 117 $this->assertNotWPError( $response ); 125 118 … … 153 146 $url = 'https://login.wordpress.org/wp-login.php'; 154 147 155 $response = wp_remote_get(148 $response = $this->wp_remote_get( 156 149 $url, 157 150 array( … … 167 160 ); 168 161 169 $this->skipTestOnTimeout( $response );170 162 $this->assertNotWPError( $response ); 171 163 … … 190 182 $url = 'https://login.wordpress.org/wp-login.php'; 191 183 192 $response = wp_remote_get(184 $response = $this->wp_remote_get( 193 185 $url, 194 186 array( … … 199 191 ); 200 192 201 $this->skipTestOnTimeout( $response );202 193 $this->assertNotWPError( $response ); 203 194
Note: See TracChangeset
for help on using the changeset viewer.