Changeset 64733
- Timestamp:
- 10/26/2026 05:52:43 PM (12 days ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/http/base.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/http/base.php
r64506 r64733 51 51 52 52 /** 53 * Local redirection fixture URL shared with instance tests after set_up_before_class(). 54 * 55 * @var string|null 56 */ 57 private static $redirection_fixture_url = null; 58 59 /** 53 60 * Skip reason when a fixture prerequisite is unavailable. 54 61 * … … 104 111 ); 105 112 return; 113 } 114 115 $redirection_copied = false; 116 $redirection_script_source = DIR_TESTDATA . '/WPHTTP-testcase-redirection-script.php'; 117 if ( file_exists( $redirection_script_source ) ) { 118 $redirection_copied = copy( $redirection_script_source, $fixture_dir . '/redirection.php' ); 106 119 } 107 120 … … 208 221 self::$file_stream_fixture_process = $process; 209 222 self::$file_stream_fixture_url = $url; 223 if ( $redirection_copied ) { 224 self::$redirection_fixture_url = 'http://127.0.0.1:' . $port . '/redirection.php'; 225 } 210 226 } 211 227 … … 226 242 227 243 self::$file_stream_fixture_url = null; 244 self::$redirection_fixture_url = null; 228 245 self::$file_stream_fixture_skip_reason = null; 229 246 self::$file_stream_fixture_fail_reason = null; … … 274 291 $this->file_stream_url = self::$file_stream_fixture_url; 275 292 } 293 294 if ( self::$redirection_fixture_url ) { 295 $this->redirection_script = self::$redirection_fixture_url; 296 } 276 297 } 277 298 … … 437 458 */ 438 459 public function test_no_redirection_on_PUT() { 439 $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?201-location=1';460 $url = $this->redirection_script . '?201-location=1'; 440 461 441 462 // Test 301 - POST to POST. … … 609 630 */ 610 631 public function test_post_redirect_to_method_300( $response_code, $method ) { 611 $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?post-redirect-to-method=1';632 $url = $this->redirection_script . '?post-redirect-to-method=1'; 612 633 613 634 $res = $this->wp_remote_post( add_query_arg( 'response_code', $response_code, $url ), array( 'timeout' => 30 ) );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)