FOSElasticaBundle/Tests/bootstrap.php
Jeremy Mikola 0391dff44e Configure Travis CI
This also changes the test suite and bootstrap to depend on packages installed by composer.
2012-03-06 20:33:50 -05:00

19 lines
535 B
PHP

<?php
if (file_exists($file = __DIR__.'/../vendor/.composer/autoload.php')) {
$loader = require_once $file;
} else {
throw new RuntimeException('Install dependencies to run test suite.');
}
spl_autoload_register(function($class) {
if (0 === strpos($class, 'FOQ\\ElasticaBundle\\')) {
$path = __DIR__.'/../'.implode('/', array_slice(explode('\\', $class), 2)).'.php';
if (!stream_resolve_include_path($path)) {
return false;
}
require_once $path;
return true;
}
});