diff --git a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php index 45c9e3ea7..50db4b2e1 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php @@ -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]); - } - } - } -} \ No newline at end of file +}