Fixed test error for testDebugAutoload() with coverage

This commit is contained in:
Anton Terekhov
2012-12-11 18:45:48 +04:00
parent 98324588b7
commit fce43da00d
4 changed files with 13 additions and 11 deletions

View File

@ -16,6 +16,8 @@ class Load
static protected $exclude = array();
static protected $builder = null;
/**
* Add exclude path for autoload. Should be called before setAutoloadFrom
* @static
@ -24,12 +26,12 @@ class Load
*/
static public function setExclude($exclude = array())
{
if(!is_array($exclude)) {
if (!is_array($exclude)) {
$exclude = array($exclude);
}
self::$exclude = array_merge(self::$exclude, $exclude);
}
static public function setAutoloadFrom($file)
{
self::$file = $file;
@ -72,12 +74,14 @@ class Load
}
$scan = array(PATH . '/' . APP . '/src', PATH . '/lib');
$exclude = array_merge(self::$exclude, array(PATH . '/.git', PATH . '/lib/core/tests', PATH . '/lib/core/.git'));
$exclude = array_merge(self::$exclude, array(PATH . '/.git', PATH . '/lib/core/tests', PATH . '/lib/core/.git'));
require_once(PATH . '/lib/core/util/AutoloadBuilder.php');
$builder = new AutoloadBuilder(self::$file, $scan, $exclude);
$builder->build();
if (!self::$builder) {
require_once(PATH . '/lib/core/util/AutoloadBuilder.php');
self::$builder = new AutoloadBuilder(self::$file, $scan, $exclude);
}
self::$builder->build();
ignore_user_abort(false);
}
}