-
Notifications
You must be signed in to change notification settings - Fork 5
/
bootstrap.php
40 lines (32 loc) · 1.3 KB
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
// Doctrine 2 must be installe via PEAR
require 'Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine', null);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Test', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Model', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxy', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Type', __DIR__);
$classLoader->register();
use Doctrine\ORM\EntityManager,
Doctrine\ORM\Configuration,
Doctrine\DBAL\Types\Type;
Type::addType('payment_method', 'Type\PaymentMethodType');
$cache = new \Doctrine\Common\Cache\ArrayCache;
$config = new Configuration;
$config->setMetadataCacheImpl($cache);
$driverImpl = $config->newDefaultAnnotationDriver(__DIR__ . '/Model');
$config->setMetadataDriverImpl($driverImpl);
$config->setQueryCacheImpl($cache);
$config->setProxyDir(__DIR__ . '/Proxy');
$config->setProxyNamespace('Proxy');
$config->setAutoGenerateProxyClasses(true);
$connectionOptions = array(
'driver' => 'pdo_sqlite',
'path' => ':memory:'
);
Test\BaseTestCase::setConfiguration($connectionOptions, $config);
unset($em, $connectionOptions, $config, $driverImpl, $cache, $classLoader);