1
0
mirror of synced 2024-12-15 23:56:02 +03:00
doctrine2/tests/Doctrine/Tests/TestInit.php

45 lines
1.6 KiB
PHP
Raw Normal View History

2008-02-09 02:20:35 +03:00
<?php
2009-01-04 19:15:32 +03:00
/*
* This file bootstraps the test environment.
*/
namespace Doctrine\Tests;
2009-01-04 19:15:32 +03:00
error_reporting(E_ALL | E_STRICT);
if (isset($GLOBALS['DOCTRINE_COMMON_PATH'])) {
2012-11-17 06:41:32 +04:00
require_once $GLOBALS['DOCTRINE_COMMON_PATH'] . '/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', $GLOBALS['DOCTRINE_COMMON_PATH']);
} else {
2012-11-17 06:41:32 +04:00
require_once __DIR__ . '/../../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/vendor/doctrine-common/lib');
}
$classLoader->register();
if (isset($GLOBALS['DOCTRINE_DBAL_PATH'])) {
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', $GLOBALS['DOCTRINE_DBAL_PATH']);
} else {
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib/vendor/doctrine-dbal/lib');
}
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\ORM', __DIR__ . '/../../../lib');
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Tests', __DIR__ . '/../../');
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor");
$classLoader->register();
2010-04-07 22:35:33 +04:00
if (!file_exists(__DIR__."/Proxies")) {
if (!mkdir(__DIR__."/Proxies")) {
throw new Exception("Could not create " . __DIR__."/Proxies Folder.");
}
}
if (!file_exists(__DIR__."/ORM/Proxy/generated")) {
if (!mkdir(__DIR__."/ORM/Proxy/generated")) {
throw new Exception("Could not create " . __DIR__."/ORM/Proxy/generated Folder.");
}
}