cvs: php4 / run-tests.php /tests/basic 011.phpt
| From: | Jani Taskinen | Date: | Tue, 23 Oct 2001 11:11:29 +0000 |
| Subject: | cvs: php4 / run-tests.php /tests/basic 011.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7961@lists.php.net to get a copy of this message | ||
sniper Tue Oct 23 07:11:29 2001 EDT
Modified files:
/php4 run-tests.php
/php4/tests/basic 011.phpt
Log:
Fix these to give correct results even if register_globals=off or
register_argc_argv=off.
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.30 php4/run-tests.php:1.31
--- php4/run-tests.php:1.30 Mon Aug 27 16:37:06 2001
+++ php4/run-tests.php Tue Oct 23 07:11:29 2001
@@ -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 @@
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_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;
}
Index: php4/tests/basic/011.phpt
diff -u php4/tests/basic/011.phpt:1.1 php4/tests/basic/011.phpt:1.2
--- php4/tests/basic/011.phpt:1.1 Sun Aug 27 15:46:04 2000
+++ php4/tests/basic/011.phpt Tue Oct 23 07:11:29 2001
@@ -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--