From 8cc23f0fd2e85e25cf77271d0f3faa6ab004d727 Mon Sep 17 00:00:00 2001 From: David Maus <maus@hab.de> Date: Sat, 29 Sep 2012 14:54:48 +0200 Subject: [PATCH] Remove hard-coded dependency on ZF2 vendor/ path --- tests/unit-tests/bootstrap.php | 33 +++++++++++++-------------------- tests/unit-tests/phpunit.xml | 3 +++ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/tests/unit-tests/bootstrap.php b/tests/unit-tests/bootstrap.php index da33eeea50b..a9b68735122 100644 --- a/tests/unit-tests/bootstrap.php +++ b/tests/unit-tests/bootstrap.php @@ -1,30 +1,23 @@ <?php /** - * Proxy service PHPUnit bootstrap. + * Proxy servce PHPUnit bootstrap. * * @author David Maus <maus@hab.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @copyright Copyright (C) Villanova University 2011 + * */ -$zf2 = realpath(__DIR__ . '/../../vendor/zf2/library/'); - -if (!class_exists('Zend\Loader\AutoloaderFactory')) { - require_once( - realpath("{$zf2}/Zend/Loader/AutoloaderFactory.php") - ); - \Zend\Loader\AutoloaderFactory::factory( - array( - 'Zend\Loader\StandardAutoloader' => array( - 'namespaces' => array( - 'Zend' => "{$zf2}/Zend" - ) - ) +require_once('Zend/Loader/AutoloaderFactory.php'); +\Zend\Loader\AutoloaderFactory::factory( + array( + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + 'VuFindProxy' => realpath(__DIR__ . '/../../src/VuFindProxy'), + 'VuFindTest' => realpath(__DIR__ . '/src/VuFindTest'), + ), + 'autoregister_zf' => true ) - ); -} - -$loader = \Zend\Loader\AutoloaderFactory::getRegisteredAutoloader('Zend\Loader\StandardAutoloader'); -$loader->registerNamespace('VuFindProxy', realpath(__DIR__ . '/../../src/VuFindProxy')); -$loader->registerNamespace('VuFindTest', realpath(__DIR__ . '/src/VuFindTest')); \ No newline at end of file + ) +); diff --git a/tests/unit-tests/phpunit.xml b/tests/unit-tests/phpunit.xml index 919b99408fc..1cbaaf01a44 100644 --- a/tests/unit-tests/phpunit.xml +++ b/tests/unit-tests/phpunit.xml @@ -8,4 +8,7 @@ <logging> <log type="coverage-html" target="../../review/coverage"/> </logging> + <php> + <includePath>../../vendor/zf2/library</includePath> + </php> </phpunit> -- GitLab