Skip to content

Commit

Permalink
Repositioned autoloading code in example and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
benwaine committed Aug 14, 2011
1 parent d74ce1a commit b01cb00
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions examples/features/bootstrap/FeatureContext.php
Expand Up @@ -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.
*/
Expand All @@ -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(
Expand Down

0 comments on commit b01cb00

Please sign in to comment.