diff options
author | Remi Collet <fedora@famillecollet.com> | 2015-04-19 07:46:00 +0200 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2015-04-19 07:46:00 +0200 |
commit | 0821e9fa9f35de961ff3a5f6d6c416f4c8ac48a2 (patch) | |
tree | adea2c5f21f09acec1a7661a5f91c09a71df8b11 /phpspec-autoload.php | |
parent | f00533bc8f3fc163fda8617a265b7e228dcd0de9 (diff) |
php-phpspec: 2.2.0
Diffstat (limited to 'phpspec-autoload.php')
-rw-r--r-- | phpspec-autoload.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/phpspec-autoload.php b/phpspec-autoload.php index fff41bc..47f19c5 100644 --- a/phpspec-autoload.php +++ b/phpspec-autoload.php @@ -1,5 +1,7 @@ <?php +/* not namespaced, use classs-map */ require_once 'phpspec/php-diff/autoload.php'; +/* prophecy and its dependencies */ require_once 'Prophecy/autoload.php'; $vendorDir = '/usr/share/php'; @@ -7,10 +9,15 @@ require_once $vendorDir . '/Symfony/Component/ClassLoader/UniversalClassLoader.p use Symfony\Component\ClassLoader\UniversalClassLoader; $loader = new UniversalClassLoader(); -$loader->registerNamespaces(array( +$ns = array( 'Doctrine\\Instantiator' => $vendorDir, 'SebastianBergmann' => $vendorDir, 'Symfony\\Component' => $vendorDir, 'PhpSpec' => dirname(__DIR__), -)); +); +/* spec tree in current dir, when exists */ +if (is_dir(getcwd().'/spec')) { + $ns['spec'] = getcwd(); +} +$loader->registerNamespaces($ns); $loader->register(); |