Skip to content
Browse files

Repositioned autoloading code in example and documentation

  • Loading branch information...
1 parent d74ce1a commit b01cb001e4223baf7a4f42d6dc56372a0b29c015 @benwaine benwaine committed Aug 14, 2011
Showing with 11 additions and 10 deletions.
  1. +11 −10 examples/features/bootstrap/FeatureContext.php
View
21 examples/features/bootstrap/FeatureContext.php
@@ -15,6 +15,16 @@
require_once 'PHPUnit/Framework/Assert/Functions.php';
require_once __DIR__ . '/../../../lib/Vendor/Doctrine/lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
+$phaLoader = new \Doctrine\Common\ClassLoader('Phabric', realpath(__DIR__ . '/../../../lib/'));
+$phaLoader->register();
+
+$docLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib/Vendor/Doctrine/lib');
+$docLoader->register();
+
+$docComLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/Vendor/Doctrine/lib/vendor/doctrine-common/lib');
+$docComLoader->register();
+
+
/**
* Features context.
*/
@@ -41,16 +51,7 @@ class FeatureContext extends BehatContext {
* @param array $parameters context parameters (set them up through behat.yml)
*/
public function __construct(array $parameters) {
-
- $phaLoader = new \Doctrine\Common\ClassLoader('Phabric', realpath(__DIR__ . '/../../../lib/'));
- $phaLoader->register();
-
- $docLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib/Vendor/Doctrine/lib');
- $docLoader->register();
-
- $docComLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/Vendor/Doctrine/lib/vendor/doctrine-common/lib');
- $docComLoader->register();
-
+
$config = new \Doctrine\DBAL\Configuration();
self::$db = \Doctrine\DBAL\DriverManager::getConnection(array(

0 comments on commit b01cb00

Please sign in to comment.
Something went wrong with that request. Please try again.