summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-05-27 17:37:34 +0800
committerXinchen Hui <laruence@php.net>2015-05-27 17:37:34 +0800
commitc17029315fa3e2d3d7501058d1fd22f08b0d26ec (patch)
tree4ef6094d3ac0c78aef28a7a7061ac85a3ac598bb /run-tests.php
parent2b41c0412451b49526e283b9f21c7aed295efa7b (diff)
downloadphp-git-c17029315fa3e2d3d7501058d1fd22f08b0d26ec.tar.gz
Fixed sapi/tests (maybe needs some run-test.php people's reviewing)
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php24
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\"";