1
0
mirror of synced 2025-02-20 22:23:14 +03:00

DDC-1641 - Fix test producing failure when skipped.

This commit is contained in:
Benjamin Eberlei 2012-02-10 21:38:42 +01:00
parent 19a4d05035
commit 299def4712

View File

@ -22,6 +22,21 @@ class SetupTest extends \Doctrine\Tests\OrmTestCase
$this->originalIncludePath = get_include_path();
}
public function tearDown()
{
if ( ! $this->originalIncludePath) {
return;
}
set_include_path($this->originalIncludePath);
$loaders = spl_autoload_functions();
for ($i = 0; $i < count($loaders); $i++) {
if ($i > $this->originalAutoloaderCount+1) {
spl_autoload_unregister($loaders[$i]);
}
}
}
public function testGitAutoload()
{
Setup::registerAutoloadGit(__DIR__ . "/../../../../../");
@ -92,15 +107,4 @@ class SetupTest extends \Doctrine\Tests\OrmTestCase
$this->assertSame($cache, $config->getMetadataCacheImpl());
$this->assertSame($cache, $config->getQueryCacheImpl());
}
public function tearDown()
{
set_include_path($this->originalIncludePath);
$loaders = spl_autoload_functions();
for ($i = 0; $i < count($loaders); $i++) {
if ($i > $this->originalAutoloaderCount+1) {
spl_autoload_unregister($loaders[$i]);
}
}
}
}
}