From 3a7bf7ce414f5b819fe12e372e9324c0f790de64 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 20 Apr 2012 10:09:12 +0200 Subject: [PATCH] Clean up autolaoder for tests --- Tests/bootstrap.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index 32d4403..8e93a19 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -6,28 +6,8 @@ function includeIfExists($file) { } } -if ((!$loader = includeIfExists(__DIR__.'/../../../../../.composer/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../vendor/.composer/autoload.php'))) { +if ((!$loader = includeIfExists(__DIR__.'/../vendor/.composer/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../../../.composer/autoload.php'))) { die('You must set up the project dependencies, run the following commands:'.PHP_EOL. 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. 'php composer.phar install'.PHP_EOL); } - -spl_autoload_register(function($class) { - if (0 === strpos($class, 'Nelmio\ApiDocBundle\\')) { - $path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php'; - if (!stream_resolve_include_path($path)) { - return false; - } - require_once $path; - return true; - } -}); - -use Doctrine\Common\Annotations\AnnotationRegistry; -AnnotationRegistry::registerLoader(function($class) { - if (strpos($class, 'Nelmio\ApiDocBundle\Annotation\\') === 0) { - $path = __DIR__.'/../'.str_replace('\\', '/', substr($class, strlen('Nelmio\ApiDocBundle\\'))) .'.php'; - require_once $path; - } - return class_exists($class, false); -});