Changeset 52010 for trunk/tests/phpunit/tests/http/base.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/http/base.php
r51568 r52010 18 18 protected $http_request_args; 19 19 20 function set_up() {20 public function set_up() { 21 21 parent::set_up(); 22 22 … … 35 35 } 36 36 37 function filter_http_request_args( array $args ) {37 public function filter_http_request_args( array $args ) { 38 38 $this->http_request_args = $args; 39 39 return $args; … … 43 43 * @covers ::wp_remote_request 44 44 */ 45 function test_redirect_on_301() {45 public function test_redirect_on_301() { 46 46 // 5 : 5 & 301. 47 47 $res = wp_remote_request( $this->redirection_script . '?code=301&rt=' . 5, array( 'redirection' => 5 ) ); … … 55 55 * @covers ::wp_remote_request 56 56 */ 57 function test_redirect_on_302() {57 public function test_redirect_on_302() { 58 58 // 5 : 5 & 302. 59 59 $res = wp_remote_request( $this->redirection_script . '?code=302&rt=' . 5, array( 'redirection' => 5 ) ); … … 69 69 * @covers ::wp_remote_request 70 70 */ 71 function test_redirect_on_301_no_redirect() {71 public function test_redirect_on_301_no_redirect() { 72 72 // 5 > 0 & 301. 73 73 $res = wp_remote_request( $this->redirection_script . '?code=301&rt=' . 5, array( 'redirection' => 0 ) ); … … 83 83 * @covers ::wp_remote_request 84 84 */ 85 function test_redirect_on_302_no_redirect() {85 public function test_redirect_on_302_no_redirect() { 86 86 // 5 > 0 & 302. 87 87 $res = wp_remote_request( $this->redirection_script . '?code=302&rt=' . 5, array( 'redirection' => 0 ) ); … … 95 95 * @covers ::wp_remote_request 96 96 */ 97 function test_redirections_equal() {97 public function test_redirections_equal() { 98 98 // 5 - 5. 99 99 $res = wp_remote_request( $this->redirection_script . '?rt=' . 5, array( 'redirection' => 5 ) ); … … 107 107 * @covers ::wp_remote_request 108 108 */ 109 function test_no_head_redirections() {109 public function test_no_head_redirections() { 110 110 // No redirections on HEAD request. 111 111 $res = wp_remote_request( $this->redirection_script . '?code=302&rt=' . 1, array( 'method' => 'HEAD' ) ); … … 121 121 * @covers ::wp_remote_request 122 122 */ 123 function test_redirect_on_head() {123 public function test_redirect_on_head() { 124 124 // Redirections on HEAD request when Requested. 125 125 $res = wp_remote_request( … … 139 139 * @covers ::wp_remote_request 140 140 */ 141 function test_redirections_greater() {141 public function test_redirections_greater() { 142 142 // 10 > 5. 143 143 $res = wp_remote_request( $this->redirection_script . '?rt=' . 10, array( 'redirection' => 5 ) ); … … 150 150 * @covers ::wp_remote_request 151 151 */ 152 function test_redirections_greater_edgecase() {152 public function test_redirections_greater_edgecase() { 153 153 // 6 > 5 (close edge case). 154 154 $res = wp_remote_request( $this->redirection_script . '?rt=' . 6, array( 'redirection' => 5 ) ); … … 161 161 * @covers ::wp_remote_request 162 162 */ 163 function test_redirections_less_edgecase() {163 public function test_redirections_less_edgecase() { 164 164 // 4 < 5 (close edge case). 165 165 $res = wp_remote_request( $this->redirection_script . '?rt=' . 4, array( 'redirection' => 5 ) ); … … 174 174 * @covers ::wp_remote_request 175 175 */ 176 function test_redirections_zero_redirections_specified() {176 public function test_redirections_zero_redirections_specified() { 177 177 // 0 redirections asked for, should return the document? 178 178 $res = wp_remote_request( $this->redirection_script . '?code=302&rt=' . 5, array( 'redirection' => 0 ) ); … … 190 190 * @covers ::wp_remote_request 191 191 */ 192 function test_location_header_on_201() {192 public function test_location_header_on_201() { 193 193 // Prints PASS on initial load, FAIL if the client follows the specified redirection. 194 194 $res = wp_remote_request( $this->redirection_script . '?201-location=true' ); … … 207 207 * @covers ::wp_remote_retrieve_body 208 208 */ 209 function test_no_redirection_on_PUT() {209 public function test_no_redirection_on_PUT() { 210 210 $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?201-location=1'; 211 211 … … 229 229 * @covers ::wp_remote_request 230 230 */ 231 function test_send_headers() {231 public function test_send_headers() { 232 232 // Test that the headers sent are received by the server. 233 233 $headers = array( … … 264 264 * @covers ::wp_remote_request 265 265 */ 266 function test_file_stream() {266 public function test_file_stream() { 267 267 $url = $this->file_stream_url; 268 268 $size = 153204; … … 294 294 * @covers ::wp_remote_request 295 295 */ 296 function test_file_stream_limited_size() {296 public function test_file_stream_limited_size() { 297 297 $url = $this->file_stream_url; 298 298 $size = 10000; … … 325 325 * @covers ::wp_remote_request 326 326 */ 327 function test_request_limited_size() {327 public function test_request_limited_size() { 328 328 $url = $this->file_stream_url; 329 329 $size = 10000; … … 352 352 * @covers ::wp_remote_retrieve_body 353 353 */ 354 function test_post_redirect_to_method_300( $response_code, $method ) {354 public function test_post_redirect_to_method_300( $response_code, $method ) { 355 355 $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?post-redirect-to-method=1'; 356 356 … … 394 394 * @covers ::wp_remote_retrieve_body 395 395 */ 396 function test_ip_url_with_host_header() {396 public function test_ip_url_with_host_header() { 397 397 $ip = gethostbyname( 'api.wordpress.org' ); 398 398 $url = 'http://' . $ip . '/core/tests/1.0/redirection.php?print-pass=1'; … … 419 419 * @covers ::wp_remote_head 420 420 */ 421 function test_https_url_without_ssl_verification() {421 public function test_https_url_without_ssl_verification() { 422 422 $url = 'https://wordpress.org/'; 423 423 $args = array( … … 446 446 * @covers ::wp_remote_retrieve_body 447 447 */ 448 function test_multiple_location_headers() {448 public function test_multiple_location_headers() { 449 449 $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?multiple-location-headers=1'; 450 450 $res = wp_remote_head( $url, array( 'timeout' => 30 ) ); … … 469 469 * @covers ::wp_remote_retrieve_body 470 470 */ 471 function test_cookie_handling() {471 public function test_cookie_handling() { 472 472 $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?cookie-test=1'; 473 473 … … 486 486 * @covers ::wp_remote_get 487 487 */ 488 function test_ssl() {488 public function test_ssl() { 489 489 if ( ! wp_http_supports( array( 'ssl' ) ) ) { 490 490 $this->fail( 'This installation of PHP does not support SSL.' ); … … 502 502 * @covers ::wp_remote_request 503 503 */ 504 function test_url_with_double_slashes_path() {504 public function test_url_with_double_slashes_path() { 505 505 $url = $this->redirection_script . '?rt=' . 0; 506 506
Note: See TracChangeset
for help on using the changeset viewer.