Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
Add standalone testing autoloading
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikbjorn committed Nov 24, 2011
1 parent 9ebe009 commit 193389d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@

use Symfony\Component\ClassLoader\UniversalClassLoader;


spl_autoload_register(function($class) {
if (0 === (strpos($class, 'Sensio\\Bundle\\FrameworkExtraBundle\\'))) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 3)).'.php';

if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Sensio\Bundle\FrameworkExtraBundle' => __DIR__ . '/../../../..',
'Symfony' => $_SERVER['SYMFONY'],
));
$loader->register();

0 comments on commit 193389d

Please sign in to comment.