summaryrefslogtreecommitdiffstats
path: root/phpspec-autoload.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpspec-autoload.php')
-rw-r--r--phpspec-autoload.php11
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();