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);
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ class Registry extends ArrayObject
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnoreStart
|
||||
* @codeCoverageIgnoreEnd
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -36,7 +36,6 @@ class LoadTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @TODO: Load->buildAutoload() should recieve AutoloadBuilder as a parameter
|
||||
* @TODO: Load->buildAutoload() - uses two paths - PATH . '/' . APP . '/src' and PATH . '/lib' those are not checked. Can cause error.
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
@ -113,7 +112,6 @@ class LoadTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @TODO: Load - check if input file returns array
|
||||
*/
|
||||
public function testFileForArray()
|
||||
{
|
||||
@ -142,7 +140,6 @@ class LoadTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @TODO: Load::getFilePath - check for wrong index
|
||||
* @runInSeparateProcess
|
||||
*/
|
||||
public function testAutoloadGetFilePathNullIndex()
|
||||
@ -160,6 +157,7 @@ class LoadTest extends PHPUnit_Framework_TestCase
|
||||
public function testDebugAutoload()
|
||||
{
|
||||
$this->setConstants();
|
||||
unlink(self::$file);
|
||||
Load::setAutoloadFrom(self::$file);
|
||||
|
||||
$autoload = require(self::$file);
|
||||
|
@ -43,7 +43,7 @@ class Profiler
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnoreStart
|
||||
* @codeCoverageIgnoreEnd
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user