Fixed test error for testDebugAutoload() with coverage
This commit is contained in:
16
Load.php
16
Load.php
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user