diff options
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/run-tests.php b/run-tests.php index 897500a58b..cbc43595ff 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1662,9 +1662,15 @@ TEST $file } $env['REDIRECT_STATUS'] = '1'; - $env['QUERY_STRING'] = $query_string; - $env['PATH_TRANSLATED'] = $test_file; - $env['SCRIPT_FILENAME'] = $test_file; + if (empty($env['QUERY_STRING'])) { + $env['QUERY_STRING'] = $query_string; + } + if (empty($env['PATH_TRANSLATED'])) { + $env['PATH_TRANSLATED'] = $test_file; + } + if (empty($env['SCRIPT_FILENAME'])) { + $env['SCRIPT_FILENAME'] = $test_file; + } if (array_key_exists('COOKIE', $section_text)) { $env['HTTP_COOKIE'] = trim($section_text['COOKIE']); @@ -1745,12 +1751,18 @@ TEST $file } else if (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) { $post = trim($section_text['POST']); - save_text($tmp_post, $post); + file_put_contents("/tmp/post", $post); $content_length = strlen($post); + save_text($tmp_post, $post); $env['REQUEST_METHOD'] = 'POST'; - $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; - $env['CONTENT_LENGTH'] = $content_length; + if (empty($env['CONTENT_TYPE'])) { + $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; + } + + if (empty($env['CONTENT_LENGTH'])) { + $env['CONTENT_LENGTH'] = $content_length; + } $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; |