Skip to content

Commit

Permalink
Tests work with ZF 2.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SocalNick committed Oct 10, 2015
1 parent 1438f69 commit be2de60
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions test/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,18 @@ protected static function initAutoloader()
$loader = include $vendorPath . '/autoload.php';
}

$zf2Path = getenv('ZF2_PATH') ?: (defined('ZF2_PATH') ? ZF2_PATH : (is_dir($vendorPath . '/zendframework/zendframework/library') ? $vendorPath . '/zendframework/zendframework/library' : false));
$zf2Path = getenv('ZF2_PATH') ?: (defined('ZF2_PATH') ? ZF2_PATH : (is_dir($vendorPath . '/zendframework') ? $vendorPath . '/zendframework' : false));

if (!$zf2Path) {
throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');
}

if (isset($loader)) {
$loader->add('Zend', $zf2Path . '/Zend');
} else {
include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
include $zf2Path . '/Zend/Loader/ClassMapAutoloader.php';
AutoloaderFactory::factory(array(
'Zend\Loader\ClassMapAutoloader' => array(array(
'ScnSocialAuth\Module' => __DIR__ . '/../Module.php',
)),
'Zend\Loader\StandardAutoloader' => array(
'autoregister_zf' => true,
'namespaces' => array(
'ScnSocialAuth' => __DIR__ . '/../src/ScnSocialAuth',
__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__,
),
),
));
return;
}

throw new RuntimeException('Unable to run tests without composer autoloader');
}

protected static function findParentPath($path)
Expand Down

0 comments on commit be2de60

Please sign in to comment.