From 1acac320c5a88a54a5965e759f1cb33b6cd71f13 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Nov 2018 23:58:00 +0100 Subject: [PATCH] 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] [2] --- run-tests.php | 4 +- sapi/{ => cgi}/tests/bug69487.phpt | 0 sapi/tests/test001.phpt | 16 ------- sapi/tests/test002.phpt | 22 --------- sapi/tests/test003.phpt | 21 --------- sapi/tests/test004.phpt | 26 ----------- sapi/tests/test005.phpt | 27 ----------- sapi/tests/test006.phpt | 72 ------------------------------ sapi/tests/test007.phpt | 45 ------------------- 9 files changed, 2 insertions(+), 231 deletions(-) rename sapi/{ => cgi}/tests/bug69487.phpt (100%) delete mode 100644 sapi/tests/test001.phpt delete mode 100644 sapi/tests/test002.phpt delete mode 100644 sapi/tests/test003.phpt delete mode 100644 sapi/tests/test004.phpt delete mode 100644 sapi/tests/test005.phpt delete mode 100644 sapi/tests/test006.phpt delete mode 100644 sapi/tests/test007.phpt diff --git a/run-tests.php b/run-tests.php index 7dd0d7b07ce..46fabbb5777 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 similarity index 100% rename from sapi/tests/bug69487.phpt rename to sapi/cgi/tests/bug69487.phpt diff --git a/sapi/tests/test001.phpt b/sapi/tests/test001.phpt deleted file mode 100644 index 318ab7a90f4..00000000000 --- 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 << ---EXPECT-- -HELLO diff --git a/sapi/tests/test002.phpt b/sapi/tests/test002.phpt deleted file mode 100644 index 4afd8e276f5..00000000000 --- 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 <<conf['TEST_PHP_EXECUTABLE'] -END; ---FILE-- - ---EXPECT-- -HELLO diff --git a/sapi/tests/test003.phpt b/sapi/tests/test003.phpt deleted file mode 100644 index 24abdbbf416..00000000000 --- 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 << ---EXPECT-- -/path/info diff --git a/sapi/tests/test004.phpt b/sapi/tests/test004.phpt deleted file mode 100644 index d1da1db6eda..00000000000 --- 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 <<conf['TEST_PHP_EXECUTABLE'] -END; ---FILE-- - ---EXPECT-- -/path/info diff --git a/sapi/tests/test005.phpt b/sapi/tests/test005.phpt deleted file mode 100644 index 85143d52285..00000000000 --- 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 << ---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 c43fe493c39..00000000000 --- a/sapi/tests/test006.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -Multipart Form POST Data ---HEADERS-- -return << ------------------------------240723202011929-- ---FILE-- - ---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 76fca8fcd6c..00000000000 --- a/sapi/tests/test007.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -Multipart Form POST Data, incorrect content length ---HEADERS-- -return << ------------------------------240723202011929-- ---FILE-- - ---EXPECT--