mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Clean up server-tests.php remains
sapi/tests/ has been introduced as a generic means to test different SAPIs[1]. run-tests2.php has later be renamed to server-tests.php and recently been dropped[2]. However, the sapi/tests/test00?.php test cases remained, even though they make no sense for run-tests.php, since they use an unsupported format for the `--ENV--` section and the completely unsupported `--HEADERS--` section, respectively. While these tests ran successfully under run-tests.php, that was only by accident, and they did not really test something useful. Therefore, we remove these tests altogether. sapi/tests/bug69487.phpt is actually a CGI test (CGI is enforced due to the `--POST--` section), so we move it to sapi/cgi/tests, which leaves sapi/tests/ empty. Thus, we also remove the sapi/ directory from run-tests.php. Finally, we remove the `--HEADERS--` and `--REQUEST--` sections from the list of allowed run-tests.php sections. [1] <http://git.php.net/?p=php-src.git;a=commit;h=b671380b6b5b6e1f4f235e810afa4199e989d2ba> [2] <http://git.php.net/?p=php-src.git;a=commit;h=4f36acb9e65935aa657f1f22e2320a401bdbdad3>
This commit is contained in:
parent
62dc39edda
commit
1acac320c5
9 changed files with 2 additions and 231 deletions
|
@ -895,7 +895,7 @@ $exts_skipped = 0;
|
||||||
$ignored_by_ext = 0;
|
$ignored_by_ext = 0;
|
||||||
sort($exts_to_test);
|
sort($exts_to_test);
|
||||||
$test_dirs = array();
|
$test_dirs = array();
|
||||||
$optionals = array('tests', 'ext', 'Zend', 'sapi');
|
$optionals = array('tests', 'ext', 'Zend');
|
||||||
|
|
||||||
foreach($optionals as $dir) {
|
foreach($optionals as $dir) {
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
|
@ -1320,7 +1320,7 @@ TEST $file
|
||||||
// check for unknown sections
|
// check for unknown sections
|
||||||
if (!in_array($section, array(
|
if (!in_array($section, array(
|
||||||
'EXPECT', 'EXPECTF', 'EXPECTREGEX', 'EXPECTREGEX_EXTERNAL', 'EXPECT_EXTERNAL', 'EXPECTF_EXTERNAL', 'EXPECTHEADERS',
|
'EXPECT', 'EXPECTF', 'EXPECTREGEX', 'EXPECTREGEX_EXTERNAL', 'EXPECT_EXTERNAL', 'EXPECTF_EXTERNAL', 'EXPECTHEADERS',
|
||||||
'POST', 'POST_RAW', 'GZIP_POST', 'DEFLATE_POST', 'PUT', 'GET', 'COOKIE', 'ARGS', 'REQUEST', 'HEADERS',
|
'POST', 'POST_RAW', 'GZIP_POST', 'DEFLATE_POST', 'PUT', 'GET', 'COOKIE', 'ARGS',
|
||||||
'FILE', 'FILEEOF', 'FILE_EXTERNAL', 'REDIRECTTEST',
|
'FILE', 'FILEEOF', 'FILE_EXTERNAL', 'REDIRECTTEST',
|
||||||
'CAPTURE_STDIO', 'STDIN', 'CGI', 'PHPDBG',
|
'CAPTURE_STDIO', 'STDIN', 'CGI', 'PHPDBG',
|
||||||
'INI', 'ENV', 'EXTENSIONS',
|
'INI', 'ENV', 'EXTENSIONS',
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
--TEST--
|
|
||||||
IIS style CGI missing SCRIPT_FILENAME
|
|
||||||
--DESCRIPTION--
|
|
||||||
This would be similar to what IIS produces for a simple query.
|
|
||||||
--ENV--
|
|
||||||
return <<<END
|
|
||||||
PATH_TRANSLATED=$filename
|
|
||||||
PATH_INFO=$scriptname
|
|
||||||
SCRIPT_NAME=$scriptname
|
|
||||||
END;
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
echo "HELLO";
|
|
||||||
?>
|
|
||||||
--EXPECT--
|
|
||||||
HELLO
|
|
|
@ -1,22 +0,0 @@
|
||||||
--TEST--
|
|
||||||
Apache style CGI
|
|
||||||
--DESCRIPTION--
|
|
||||||
Apache likes to set SCRIPT_FILENAME to the php executable
|
|
||||||
if you use ScriptAlias configurations, and the proper
|
|
||||||
path is in PATH_TRANSLATED. SCRIPT_NAME in this is faked,
|
|
||||||
but that is ok, Apache sets SCRIPT_NAME to the ScriptAlias
|
|
||||||
of the executable.
|
|
||||||
--ENV--
|
|
||||||
return <<<END
|
|
||||||
REDIRECT_URL=$scriptname
|
|
||||||
PATH_TRANSLATED=$filename
|
|
||||||
PATH_INFO=$scriptname
|
|
||||||
SCRIPT_NAME=/scriptalias/php
|
|
||||||
SCRIPT_FILENAME=$this->conf['TEST_PHP_EXECUTABLE']
|
|
||||||
END;
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
echo "HELLO";
|
|
||||||
?>
|
|
||||||
--EXPECT--
|
|
||||||
HELLO
|
|
|
@ -1,21 +0,0 @@
|
||||||
--TEST--
|
|
||||||
IIS style CGI missing SCRIPT_FILENAME, has PATH_INFO
|
|
||||||
--DESCRIPTION--
|
|
||||||
This would be similar to what IIS produces for a simple query
|
|
||||||
that also has PATH_INFO.
|
|
||||||
--REQUEST--
|
|
||||||
return <<<END
|
|
||||||
PATH_INFO=/path/info
|
|
||||||
END;
|
|
||||||
--ENV--
|
|
||||||
return <<<END
|
|
||||||
PATH_TRANSLATED=/path/bla
|
|
||||||
PATH_INFO=/path/info
|
|
||||||
SCRIPT_NAME=path
|
|
||||||
END;
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
echo $_SERVER['PATH_INFO'];
|
|
||||||
?>
|
|
||||||
--EXPECT--
|
|
||||||
/path/info
|
|
|
@ -1,26 +0,0 @@
|
||||||
--TEST--
|
|
||||||
Apache style CGI with PATH_INFO
|
|
||||||
--DESCRIPTION--
|
|
||||||
Apache likes to set SCRIPT_FILENAME to the php executable
|
|
||||||
if you use ScriptAlias configurations, and the proper
|
|
||||||
path is in PATH_TRANSLATED. SCRIPT_NAME in this is faked,
|
|
||||||
but that is ok, Apache sets SCRIPT_NAME to the ScriptAlias
|
|
||||||
of the executable.
|
|
||||||
--REQUEST--
|
|
||||||
return <<<END
|
|
||||||
PATH_INFO=/path/info
|
|
||||||
END;
|
|
||||||
--ENV--
|
|
||||||
return <<<END
|
|
||||||
REDIRECT_URL=/path
|
|
||||||
PATH_TRANSLATED=/path/info/fpp
|
|
||||||
PATH_INFO=/path/info
|
|
||||||
SCRIPT_NAME=/scriptalias/php
|
|
||||||
SCRIPT_FILENAME=$this->conf['TEST_PHP_EXECUTABLE']
|
|
||||||
END;
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
echo $_SERVER['PATH_INFO'];
|
|
||||||
?>
|
|
||||||
--EXPECT--
|
|
||||||
/path/info
|
|
|
@ -1,27 +0,0 @@
|
||||||
--TEST--
|
|
||||||
QUERY_STRING Security Bug
|
|
||||||
--DESCRIPTION--
|
|
||||||
This bug was present in PHP 4.3.0 only.
|
|
||||||
A failure should print HELLO.
|
|
||||||
--REQUEST--
|
|
||||||
return <<<END
|
|
||||||
SCRIPT_NAME=/nothing.php
|
|
||||||
QUERY_STRING=$filename
|
|
||||||
END;
|
|
||||||
--ENV--
|
|
||||||
return <<<END
|
|
||||||
REDIRECT_URL=$scriptname
|
|
||||||
PATH_TRANSLATED=c:\apache\1.3.27\htdocs\nothing.php
|
|
||||||
QUERY_STRING=$filename
|
|
||||||
PATH_INFO=/nothing.php
|
|
||||||
SCRIPT_NAME=/phpexe/php.exe/nothing.php
|
|
||||||
SCRIPT_FILENAME=c:\apache\1.3.27\htdocs\nothing.php
|
|
||||||
END;
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
echo "HELLO";
|
|
||||||
?>
|
|
||||||
--EXPECTHEADERS--
|
|
||||||
Status: 404 Not Found
|
|
||||||
--EXPECT--
|
|
||||||
No input file specified.
|
|
|
@ -1,72 +0,0 @@
|
||||||
--TEST--
|
|
||||||
Multipart Form POST Data
|
|
||||||
--HEADERS--
|
|
||||||
return <<<END
|
|
||||||
Content-Type=multipart/form-data; boundary=---------------------------240723202011929
|
|
||||||
Content-Length=862
|
|
||||||
END;
|
|
||||||
--ENV--
|
|
||||||
return <<<END
|
|
||||||
CONTENT_TYPE=multipart/form-data; boundary=---------------------------240723202011929
|
|
||||||
CONTENT_LENGTH=862
|
|
||||||
END;
|
|
||||||
--POST--
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="entry"
|
|
||||||
|
|
||||||
entry box
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="password"
|
|
||||||
|
|
||||||
password box
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="radio1"
|
|
||||||
|
|
||||||
test 1
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="checkbox1"
|
|
||||||
|
|
||||||
test 1
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="choices"
|
|
||||||
|
|
||||||
Choice 1
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="choices"
|
|
||||||
|
|
||||||
Choice 2
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="file"; filename="info.php"
|
|
||||||
Content-Type: application/octet-stream
|
|
||||||
|
|
||||||
<?php
|
|
||||||
phpinfo();
|
|
||||||
?>
|
|
||||||
-----------------------------240723202011929--
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
error_reporting(0);
|
|
||||||
print_r($_POST);
|
|
||||||
print_r($_FILES);
|
|
||||||
?>
|
|
||||||
--EXPECTF--
|
|
||||||
Array
|
|
||||||
(
|
|
||||||
[entry] => entry box
|
|
||||||
[password] => password box
|
|
||||||
[radio1] => test 1
|
|
||||||
[checkbox1] => test 1
|
|
||||||
[choices] => Choice 2
|
|
||||||
)
|
|
||||||
Array
|
|
||||||
(
|
|
||||||
[file] => Array
|
|
||||||
(
|
|
||||||
[name] => info.php
|
|
||||||
[type] => application/octet-stream
|
|
||||||
[tmp_name] => %s
|
|
||||||
[error] => 0
|
|
||||||
[size] => 19
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
|
|
@ -1,45 +0,0 @@
|
||||||
--TEST--
|
|
||||||
Multipart Form POST Data, incorrect content length
|
|
||||||
--HEADERS--
|
|
||||||
return <<<END
|
|
||||||
Content-Type=multipart/form-data; boundary=---------------------------240723202011929
|
|
||||||
Content-Length=100
|
|
||||||
END;
|
|
||||||
--POST--
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="entry"
|
|
||||||
|
|
||||||
entry box
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="password"
|
|
||||||
|
|
||||||
password box
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="radio1"
|
|
||||||
|
|
||||||
test 1
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="checkbox1"
|
|
||||||
|
|
||||||
test 1
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="choices"
|
|
||||||
|
|
||||||
Choice 1
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="choices"
|
|
||||||
|
|
||||||
Choice 2
|
|
||||||
-----------------------------240723202011929
|
|
||||||
Content-Disposition: form-data; name="file"; filename="info.php"
|
|
||||||
Content-Type: application/octet-stream
|
|
||||||
|
|
||||||
<?php
|
|
||||||
phpinfo();
|
|
||||||
?>
|
|
||||||
-----------------------------240723202011929--
|
|
||||||
--FILE--
|
|
||||||
<?php
|
|
||||||
print @$_POST['choices'];
|
|
||||||
?>
|
|
||||||
--EXPECT--
|
|
Loading…
Add table
Add a link
Reference in a new issue