Browse Source

Fixed test error for testDebugAutoload() with coverage

namespace
Anton Terekhov 12 years ago
parent
commit
fce43da00d
  1. 10
      Load.php
  2. 2
      Registry.php
  3. 4
      tests/LoadTest.php
  4. 2
      util/profiler/Profiler.php

10
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
@ -74,10 +76,12 @@ 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'));
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);
}
}

2
Registry.php

@ -42,7 +42,7 @@ class Registry extends ArrayObject
}
/**
* @codeCoverageIgnoreStart
* @codeCoverageIgnoreEnd
*/
/**

4
tests/LoadTest.php

@ -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);

2
util/profiler/Profiler.php

@ -43,7 +43,7 @@ class Profiler
}
/**
* @codeCoverageIgnoreStart
* @codeCoverageIgnoreEnd
*/
/**

Loading…
Cancel
Save