From 599ba35dd142d7d65e7e4fbfa779840eaa0a8d9f Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sat, 13 Jan 2007 13:23:46 +0000 Subject: [PATCH] - Do not force xdebug.collect_vars=1 because it slows down the execution. If your tests rely on variables that are set in the global scope of your test case's source (see http://pear.php.net/bugs/bug.php?id=5053) you need to set this in your php.ini configuration file. --- PHPUnit/Util/Fileloader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PHPUnit/Util/Fileloader.php b/PHPUnit/Util/Fileloader.php index 9cbdd4f80d5..db3c9dd927a 100644 --- a/PHPUnit/Util/Fileloader.php +++ b/PHPUnit/Util/Fileloader.php @@ -48,9 +48,6 @@ PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); -// Needed for xdebug_get_declared_vars(). -ini_set('xdebug.collect_vars', 1); - /** * * @@ -124,13 +121,16 @@ public static function getIncludePaths() */ protected static function load($filename) { - if (function_exists('xdebug_get_declared_vars')) { + $xdebugLoaded = extension_loaded('xdebug'); + $xdebugCollectVars = $xdebugLoaded && ini_get('xdebug.collect_vars') == '1'; + + if ($xdebugCollectVars) { $variables = array('variables', xdebug_get_declared_vars()); } include_once $filename; - if (function_exists('xdebug_get_declared_vars')) { + if ($xdebugCollectVars) { $variables = array_values( array_diff(xdebug_get_declared_vars(), $variables) );