summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-10-23 11:11:29 +0000
committerfoobar <sniper@php.net>2001-10-23 11:11:29 +0000
commit76fcdc1afbfa34c2de136d83172bec91b1891ed2 (patch)
treeaf1f4fe61e2d43b17edfad0931b7401f346d035f
parent0b2af004c1ba658ea48f0cf9e572c189c78be783 (diff)
downloadphp-git-76fcdc1afbfa34c2de136d83172bec91b1891ed2.tar.gz
Fix these to give correct results even if register_globals=off or
register_argc_argv=off.
-rwxr-xr-xrun-tests.php11
-rw-r--r--tests/basic/011.phpt12
2 files changed, 19 insertions, 4 deletions
diff --git a/run-tests.php b/run-tests.php
index b7417da4bd..8e11e5dbef 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -25,6 +25,8 @@
* - do not test PEAR components if base class and/or component class cannot be instanciated
*/
+set_time_limit(0);
+
ob_implicit_flush();
define('TEST_PASSED', 0);
@@ -43,7 +45,12 @@ if ($opts['help']) {
exit;
}
*/
-do_testing($argc, $argv);
+
+if(!isset($_SERVER['argc'])) {
+ echo "\nWARNING: register_argc_argv seems to be set 'off' in php.ini\n\n";
+}
+
+@do_testing($_SERVER['argc'], $_SERVER['argv']);
exit;
@@ -97,7 +104,7 @@ function create_found_tests_4_modules_list() {
function create_modules_2_test_list() {
global $compiled_in_modules,$modules_2_test,$modules_available;
foreach ($compiled_in_modules AS $value)
- if ($modules_2_test[$value]) $modules_available[]=$value;
+ if (isset($modules_2_test[$value])) $modules_available[]=$value;
}
diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt
index 7c2d395b9d..9320c16c16 100644
--- a/tests/basic/011.phpt
+++ b/tests/basic/011.phpt
@@ -1,12 +1,20 @@
--TEST--
Testing $argc and $argv handling
+--SKIPIF--
+<?php if(ini_get('register_argc_argv') == '') echo 'skip'; ?>
--POST--
--GET--
ab+cd+ef+123+test
--FILE--
<?php
- for($i=0;$i<$argc;$i++) {
- echo "$i: ".$argv[$i]."\n";
+ if(ini_get('register_globals') != '') {
+ for($i=0;$i<$argc;$i++) {
+ echo "$i: ".$argv[$i]."\n";
+ }
+ } else {
+ for($i=0;$i<$_SERVER['argc'];$i++) {
+ echo "$i: ".$_SERVER['argv'][$i]."\n";
+ }
}
?>
--EXPECT--