summaryrefslogtreecommitdiff
path: root/run-tests.php
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-12-09 14:14:29 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-12-09 14:14:29 +0000
commit94e3f478d75f18fb8bec2527bc7a56fe8dce3b6d (patch)
treea5b523035da5840f830e862a8112ae9787a4afca /run-tests.php
parent847741cb08f79676c80e7fffadc108854683f343 (diff)
downloadphp-git-94e3f478d75f18fb8bec2527bc7a56fe8dce3b6d.tar.gz
Fixed handling of multiple cookies with the same name.
Added support for cookies into run-tests.php
Diffstat (limited to 'run-tests.php')
-rwxr-xr-xrun-tests.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/run-tests.php b/run-tests.php
index 74b51b8dfe..9be3bece53 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -950,13 +950,14 @@ TEST $file
'TEST' => '',
'SKIPIF' => '',
'GET' => '',
+ 'COOKIE' => '',
'POST_RAW' => '',
'POST' => '',
'UPLOAD' => '',
'ARGS' => '',
);
- $fp = @fopen($file, "rt") or error("Cannot open test file: $file");
+ $fp = fopen($file, "rt") or error("Cannot open test file: $file");
$borked = false;
$bork_info = '';
@@ -1039,7 +1040,7 @@ TEST $file
$tested = trim($section_text['TEST']);
/* For GET/POST tests, check if cgi sapi is available and if it is, use it. */
- if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW'])) {
+ if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['COOKIE'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi .' -C ';
@@ -1288,6 +1289,12 @@ TEST $file
$env['PATH_TRANSLATED'] = $test_file;
$env['SCRIPT_FILENAME'] = $test_file;
+ if (array_key_exists('COOKIE', $section_text)) {
+ $env['HTTP_COOKIE'] = trim($section_text['COOKIE']);
+ } else {
+ $env['HTTP_COOKIE'] = '';
+ }
+
$args = $section_text['ARGS'] ? ' -- '.$section_text['ARGS'] : '';
if (array_key_exists('POST_RAW', $section_text) && !empty($section_text['POST_RAW'])) {
@@ -1347,6 +1354,7 @@ QUERY_STRING = " . $env['QUERY_STRING'] . "
REDIRECT_STATUS = " . $env['REDIRECT_STATUS'] . "
REQUEST_METHOD = " . $env['REQUEST_METHOD'] . "
SCRIPT_FILENAME = " . $env['SCRIPT_FILENAME'] . "
+HTTP_COOKIE = " . $env['HTTP_COOKIE'] . "
COMMAND $cmd
";