Permalink
Browse files

[Tests] Use Zend_Autoloader when Composer's autoloader is not present.

Note: If your tests are failing after this patch probably you need to do "php composer.phat update" to update Composer's autoloader with the new lists of namespaces
  • Loading branch information...
Maks3w committed Aug 6, 2012
1 parent ddabfe7 commit 2ea4896e2302e7ebf4c3a4754a0d793046144d4d
Showing with 9 additions and 11 deletions.
  1. +9 −11 tests/_autoload.php
View
@@ -3,19 +3,17 @@
* Setup autoloading
*/
-// Setup autoloading for ZendTest assets
-require_once __DIR__ . '/../library/Zend/Loader/StandardAutoloader.php';
-$loader = new Zend\Loader\StandardAutoloader(
- array(
- Zend\Loader\StandardAutoloader::LOAD_NS => array(
- 'ZendTest' => __DIR__ . '/ZendTest',
- ),
- ));
-$loader->register();
-
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
include_once __DIR__ . '/../vendor/autoload.php';
} else {
// if composer autoloader is missing, explicitly add the ZF library path
- $loader->registerNamespace('Zend', __DIR__ . '/../library/Zend');
+ require_once __DIR__ . '/../library/Zend/Loader/StandardAutoloader.php';
+ $loader = new Zend\Loader\StandardAutoloader(
+ array(
+ Zend\Loader\StandardAutoloader::LOAD_NS => array(
+ 'Zend' => __DIR__ . '/../library/Zend',
+ 'ZendTest' => __DIR__ . '/ZendTest',
+ ),
+ ));
+ $loader->register();
}

0 comments on commit 2ea4896

Please sign in to comment.