diff --git a/admin/tool/phpunit/cli/util.php b/admin/tool/phpunit/cli/util.php index 7e063bd8287..7a792865f18 100644 --- a/admin/tool/phpunit/cli/util.php +++ b/admin/tool/phpunit/cli/util.php @@ -83,6 +83,7 @@ if ($options['run']) { foreach ($_SERVER['argv'] as $k=>$v) { if (strpos($v, '--run') === 0 or strpos($v, '--phpunitdir') === 0) { unset($_SERVER['argv'][$k]); + $_SERVER['argc'] = $_SERVER['argc'] - 1; } } $_SERVER['argv'] = array_values($_SERVER['argv']); diff --git a/lib/phpunit/bootstraplib.php b/lib/phpunit/bootstraplib.php index 93bc164db38..6a61b0d34db 100644 --- a/lib/phpunit/bootstraplib.php +++ b/lib/phpunit/bootstraplib.php @@ -58,7 +58,7 @@ function phpunit_bootstrap_error($errorcode, $text = '') { $text = 'Unknown error '.$errorcode.$text; break; } - if (PHPUNIT_UTIL) { + if (defined('PHPUNIT_UTIL') and PHPUNIT_UTIL) { // do not write to error stream because we need the error message in PHP exec from web ui echo($text."\n"); } else {