From ea541bc1b175abb495186dc6582929d565f9592f Mon Sep 17 00:00:00 2001 From: rurban Date: Thu, 25 Nov 2004 07:58:46 +0000 Subject: [PATCH] handle defaults without any args git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4180 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- tests/unit/test.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/unit/test.php b/tests/unit/test.php index f95a11512..4d459f164 100644 --- a/tests/unit/test.php +++ b/tests/unit/test.php @@ -263,7 +263,8 @@ function html_option_form() { HTML::br())); unset($input); $option = HTML::div(array('class' => 'option'), 'defines: ', HTML::br()); - foreach ($GLOBALS['define'] as $s) { + if (!empty($GLOBALS['define'])) + foreach ($GLOBALS['define'] as $s) { if (defined($s)) { $input = array('type' => 'edit', 'name' => $s, 'value' => constant($s)); $option->pushContent(HTML::input($input), $s, HTML::br()); @@ -318,8 +319,9 @@ if (isset($HTTP_SERVER_VARS['REQUEST_METHOD'])) { else $argv[] = $key."=".$val; } -} elseif (!empty($argv) and preg_match("/test\.php$/", $argv[0])) +} elseif (!empty($argv) and preg_match("/test\.php$/", $argv[0])) { array_shift($argv); +} if (!empty($argv)) { $runtests = array(); $define = array(); @@ -365,6 +367,11 @@ if (!empty($argv)) { echo "\n"; } flush(); +} else { + if (empty($run_database_backends)) + $run_database_backends = $database_backends; + if (empty($runtests)) + $runtests = $alltests; } if (!defined('DEBUG')) define('DEBUG', $debug_level); -- 2.45.0