summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-11-21 23:58:00 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2018-11-23 16:24:51 +0100
commit1acac320c5a88a54a5965e759f1cb33b6cd71f13 (patch)
treebbfe722ab322c327219fce5fe0c719e9276c435a
parent62dc39edda2a0a95151d3dc424698ee8b53d3471 (diff)
downloadphp-git-1acac320c5a88a54a5965e759f1cb33b6cd71f13.tar.gz
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>
-rwxr-xr-xrun-tests.php4
-rw-r--r--sapi/cgi/tests/bug69487.phpt (renamed from sapi/tests/bug69487.phpt)0
-rw-r--r--sapi/tests/test001.phpt16
-rw-r--r--sapi/tests/test002.phpt22
-rw-r--r--sapi/tests/test003.phpt21
-rw-r--r--sapi/tests/test004.phpt26
-rw-r--r--sapi/tests/test005.phpt27
-rw-r--r--sapi/tests/test006.phpt72
-rw-r--r--sapi/tests/test007.phpt45
9 files changed, 2 insertions, 231 deletions
diff --git a/run-tests.php b/run-tests.php
index 7dd0d7b07c..46fabbb577 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -895,7 +895,7 @@ $exts_skipped = 0;
$ignored_by_ext = 0;
sort($exts_to_test);
$test_dirs = array();
-$optionals = array('tests', 'ext', 'Zend', 'sapi');
+$optionals = array('tests', 'ext', 'Zend');
foreach($optionals as $dir) {
if (is_dir($dir)) {
@@ -1320,7 +1320,7 @@ TEST $file
// check for unknown sections
if (!in_array($section, array(
'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',
'CAPTURE_STDIO', 'STDIN', 'CGI', 'PHPDBG',
'INI', 'ENV', 'EXTENSIONS',
diff --git a/sapi/tests/bug69487.phpt b/sapi/cgi/tests/bug69487.phpt
index 3ac3796826..3ac3796826 100644
--- a/sapi/tests/bug69487.phpt
+++ b/sapi/cgi/tests/bug69487.phpt
diff --git a/sapi/tests/test001.phpt b/sapi/tests/test001.phpt
deleted file mode 100644
index 318ab7a90f..0000000000
--- a/sapi/tests/test001.phpt
+++ /dev/null
@@ -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
diff --git a/sapi/tests/test002.phpt b/sapi/tests/test002.phpt
deleted file mode 100644
index 4afd8e276f..0000000000
--- a/sapi/tests/test002.phpt
+++ /dev/null
@@ -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
diff --git a/sapi/tests/test003.phpt b/sapi/tests/test003.phpt
deleted file mode 100644
index 24abdbbf41..0000000000
--- a/sapi/tests/test003.phpt
+++ /dev/null
@@ -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
diff --git a/sapi/tests/test004.phpt b/sapi/tests/test004.phpt
deleted file mode 100644
index d1da1db6ed..0000000000
--- a/sapi/tests/test004.phpt
+++ /dev/null
@@ -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
diff --git a/sapi/tests/test005.phpt b/sapi/tests/test005.phpt
deleted file mode 100644
index 85143d5228..0000000000
--- a/sapi/tests/test005.phpt
+++ /dev/null
@@ -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.
diff --git a/sapi/tests/test006.phpt b/sapi/tests/test006.phpt
deleted file mode 100644
index c43fe493c3..0000000000
--- a/sapi/tests/test006.phpt
+++ /dev/null
@@ -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
- )
-
-)
diff --git a/sapi/tests/test007.phpt b/sapi/tests/test007.phpt
deleted file mode 100644
index 76fca8fcd6..0000000000
--- a/sapi/tests/test007.phpt
+++ /dev/null
@@ -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--