Permalink
Browse files

- Do not force xdebug.collect_vars=1 because it slows down the execut…

…ion.

  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.
  • Loading branch information...
1 parent e09d155 commit 599ba35dd142d7d65e7e4fbfa779840eaa0a8d9f @sebastianbergmann committed Jan 13, 2007
Showing with 5 additions and 5 deletions.
  1. +5 −5 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)
);

0 comments on commit 599ba35

Please sign in to comment.