diff options
author | Xinchen Hui <laruence@php.net> | 2015-05-27 17:37:34 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-05-27 17:37:34 +0800 |
commit | c17029315fa3e2d3d7501058d1fd22f08b0d26ec (patch) | |
tree | 4ef6094d3ac0c78aef28a7a7061ac85a3ac598bb | |
parent | 2b41c0412451b49526e283b9f21c7aed295efa7b (diff) | |
download | php-git-c17029315fa3e2d3d7501058d1fd22f08b0d26ec.tar.gz |
Fixed sapi/tests (maybe needs some run-test.php people's reviewing)
-rwxr-xr-x | run-tests.php | 24 | ||||
-rw-r--r-- | sapi/tests/test005.phpt | 4 | ||||
-rw-r--r-- | sapi/tests/test006.phpt | 2 |
3 files changed, 21 insertions, 9 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\""; diff --git a/sapi/tests/test005.phpt b/sapi/tests/test005.phpt index 7415b66a0a..85143d5228 100644 --- a/sapi/tests/test005.phpt +++ b/sapi/tests/test005.phpt @@ -22,6 +22,6 @@ END; echo "HELLO"; ?> --EXPECTHEADERS-- -Status: 404 +Status: 404 Not Found --EXPECT-- -No input file specified.
\ No newline at end of file +No input file specified. diff --git a/sapi/tests/test006.phpt b/sapi/tests/test006.phpt index 45e37811ef..16d1b2b840 100644 --- a/sapi/tests/test006.phpt +++ b/sapi/tests/test006.phpt @@ -67,7 +67,7 @@ Array [type] => application/octet-stream [tmp_name] => %s [error] => 0 - [size] => 21 + [size] => 19 ) ) |