Skip to content
Snippets Groups Projects
Commit b6e4d5fd authored by Demian Katz's avatar Demian Katz
Browse files

Resolving VUFIND-666 (don't require ZF2 bootstrap for testing).

Thanks to David Maus.
parent dbafff81
No related merge requests found
...@@ -33,26 +33,15 @@ set_include_path(implode(PATH_SEPARATOR, $pathParts)); ...@@ -33,26 +33,15 @@ set_include_path(implode(PATH_SEPARATOR, $pathParts));
// Composer autoloading // Composer autoloading
if (file_exists('vendor/autoload.php')) { if (file_exists('vendor/autoload.php')) {
$loader = include 'vendor/autoload.php'; $loader = include 'vendor/autoload.php';
$loader = new Composer\Autoload\ClassLoader();
$loader->add('VuFindTest', __DIR__ . '/unit-tests/src');
$loader->add('VuFindTest', __DIR__ . '/../src');
$loader->add('VuFind', __DIR__ . '/../src');
$loader->add('VuFindHttp', __DIR__ . '/../../VuFindHttp/src');
$loader->add('VuFindSearch', __DIR__ . '/../../VuFindSearch/src');
$loader->register();
} }
if (!class_exists('Zend\Loader\AutoloaderFactory')) {
throw new RuntimeException('Unable to load ZF2.');
}
// Get application stack configuration
$configuration = include 'config/application.config.php';
// Setup service manager
$serviceManager = new ServiceManager(new ServiceManagerConfig($configuration['service_manager']));
$serviceManager->setService('ApplicationConfig', $configuration);
$serviceManager->get('ModuleManager')->loadModules();
// Setup autoloader for VuFindTest classes
$loader = Zend\Loader\AutoloaderFactory::getRegisteredAutoloader(
Zend\Loader\AutoloaderFactory::STANDARD_AUTOLOADER
);
$loader->registerNamespace('VuFindTest', __DIR__ . '/../src/VuFindTest');
define('PHPUNIT_SEARCH_FIXTURES', realpath(__DIR__ . '/../../VuFindSearch/tests/unit-tests/fixtures')); define('PHPUNIT_SEARCH_FIXTURES', realpath(__DIR__ . '/../../VuFindSearch/tests/unit-tests/fixtures'));
// Use output buffering -- some tests involve HTTP headers and will fail if there is output. // Use output buffering -- some tests involve HTTP headers and will fail if there is output.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment