[2.0] Making use of new constant __DIR__
This commit is contained in:
parent
9a55035883
commit
0ac97e7adf
@ -10,7 +10,7 @@
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
class Doctrine_ORM_ActiveEntity extends Doctrine_Common_VirtualPropertyObject implements Doctrine_ORM_Entity
|
||||
class Doctrine_ORM_ActiveEntity
|
||||
{
|
||||
/**
|
||||
* The class descriptor.
|
||||
|
@ -44,10 +44,21 @@ class Configuration extends \Doctrine\DBAL\Configuration
|
||||
'resultCacheImpl' => null,
|
||||
'queryCacheImpl' => null,
|
||||
'metadataCacheImpl' => null,
|
||||
'metadataDriverImpl' => new AnnotationDriver()
|
||||
'metadataDriverImpl' => new AnnotationDriver(),
|
||||
'automaticDirtyChecking' => true
|
||||
));
|
||||
}
|
||||
|
||||
public function setAutomaticDirtyChecking($bool)
|
||||
{
|
||||
$this->_attributes['automaticDirtyChecking'] = $bool;
|
||||
}
|
||||
|
||||
public function getAutomaticDirtyChecking()
|
||||
{
|
||||
return $this->_attributes['automaticDirtyChecking'];
|
||||
}
|
||||
|
||||
public function setMetadataDriverImpl($driverImpl)
|
||||
{
|
||||
$this->_attributes['metadataDriverImpl'] = $driverImpl;
|
||||
|
@ -262,6 +262,8 @@ class UnitOfWork
|
||||
foreach ($entities as $entity) {
|
||||
$entitySet[get_class($entity)][] = $entity;
|
||||
}
|
||||
} else if ( ! $this->_em->getConfiguration()->getAutomaticDirtyChecking()) {
|
||||
//TODO
|
||||
} else {
|
||||
$entitySet = $this->_identityMap;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/TestInit.php';
|
||||
require_once __DIR__ . '/TestInit.php';
|
||||
|
||||
// Suites
|
||||
#require_once 'Common/AllTests.php';
|
||||
|
@ -8,7 +8,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Common_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../TestInit.php';
|
||||
require_once __DIR__ . '/../TestInit.php';
|
||||
|
||||
// Suites
|
||||
#require_once 'Common/Collections/AllTests.php';
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Common_Collections_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
// Tests
|
||||
#require_once 'Common/Collections/CollectionTest.php';
|
||||
|
@ -4,7 +4,7 @@ namespace Doctrine\Tests\Common\Collections;
|
||||
|
||||
use Doctrine\Tests;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Collection tests.
|
||||
|
@ -9,7 +9,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Dbal_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../TestInit.php';
|
||||
require_once __DIR__ . '/../TestInit.php';
|
||||
|
||||
// Suites
|
||||
#require_once 'Dbal/Component/AllTests.php';
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Dbal_Component_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
// Tests
|
||||
#require_once 'Dbal/Component/TestTest.php';
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\DBAL\Component;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class TestTest extends \Doctrine\Tests\DbalTestCase
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Ticket_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
// Tests
|
||||
#require_once 'Dbal/Ticket/1Test.php';
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\DBAL\Ticket;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class Test1 extends \Doctrine\Tests\DbalTestCase
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Orm_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../TestInit.php';
|
||||
require_once __DIR__ . '/../TestInit.php';
|
||||
|
||||
class AllTests
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Orm_Associations_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class AllTests
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Associations;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class OneToOneMappingTest extends \Doctrine\Tests\OrmTestCase
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM;
|
||||
|
||||
require_once dirname(__FILE__) . '/../TestInit.php';
|
||||
require_once __DIR__ . '/../TestInit.php';
|
||||
|
||||
/**
|
||||
* Tests of the commit order calculation.
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Orm_Entity_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
|
||||
class AllTests
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Entity;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class ConstructorTest extends \Doctrine\Tests\OrmTestCase
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM;
|
||||
|
||||
require_once dirname(__FILE__) . '/../TestInit.php';
|
||||
require_once __DIR__ . '/../TestInit.php';
|
||||
|
||||
/**
|
||||
* EntityManager tests.
|
||||
|
@ -10,7 +10,7 @@ use Doctrine\Tests\Mocks\SequenceMock;
|
||||
use Doctrine\Tests\Models\Forum\ForumUser;
|
||||
use Doctrine\Tests\Models\Forum\ForumAvatar;
|
||||
|
||||
require_once dirname(__FILE__) . '/../TestInit.php';
|
||||
require_once __DIR__ . '/../TestInit.php';
|
||||
|
||||
#require_once 'lib/mocks/Doctrine_EntityManagerMock.php';
|
||||
#require_once 'lib/mocks/Doctrine_ConnectionMock.php';
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Orm_Functional_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class AllTests
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ use Doctrine\ORM\Export\ClassExporter;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Description of BasicCRUDTest
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Orm_Hydration_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
|
||||
class AllTests
|
||||
|
@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Hydration;
|
||||
|
||||
use Doctrine\Tests\Mocks\HydratorMockStatement;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Description of ArrayHydratorTest
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Hydration;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Description of HydrationTest
|
||||
|
@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Hydration;
|
||||
|
||||
use Doctrine\Tests\Mocks\HydratorMockStatement;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Description of ObjectHydratorTest
|
||||
|
@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Hydration;
|
||||
|
||||
use Doctrine\Tests\Mocks\HydratorMockStatement;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Description of ScalarHydratorTest
|
||||
|
@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Hydration;
|
||||
|
||||
use Doctrine\Tests\Mocks\HydratorMockStatement;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Description of SingleScalarHydratorTest
|
||||
|
@ -6,7 +6,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Orm_Mapping_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class AllTests
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ use Doctrine\Tests\Mocks\MetadataDriverMock;
|
||||
use Doctrine\Tests\Mocks\DatabasePlatformMock;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Description of ClassMetadataFactoryTest
|
||||
|
@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Mapping;
|
||||
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
|
||||
define('PHPUnit_MAIN_METHOD', 'Orm_Query_AllTests::main');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
#require_once 'IdentifierRecognitionTest.php';
|
||||
/*require_once 'ScannerTest.php';
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Query;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Test case for testing the saving and referencing of query identifiers.
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
namespace Doctrine\Tests\ORM\Query;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../TestInit.php';
|
||||
require_once __DIR__ . '/../../TestInit.php';
|
||||
|
||||
/**
|
||||
* Test case for testing the saving and referencing of query identifiers.
|
||||
|
@ -11,7 +11,7 @@ use Doctrine\Tests\Mocks\IdentityIdGeneratorMock;
|
||||
use Doctrine\Tests\Models\Forum\ForumUser;
|
||||
use Doctrine\Tests\Models\Forum\ForumAvatar;
|
||||
|
||||
require_once dirname(__FILE__) . '/../TestInit.php';
|
||||
require_once __DIR__ . '/../TestInit.php';
|
||||
|
||||
#require_once 'lib/mocks/Doctrine_EntityManagerMock.php';
|
||||
#require_once 'lib/mocks/Doctrine_ConnectionMock.php';
|
||||
|
@ -13,10 +13,10 @@ $classLoader = new \Doctrine\Common\ClassLoader();
|
||||
//$classLoader->setCheckFileExists(true);
|
||||
$classLoader->register();
|
||||
|
||||
$modelDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'models';
|
||||
$modelDir = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'models';
|
||||
set_include_path(
|
||||
get_include_path()
|
||||
. PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
|
||||
. PATH_SEPARATOR . __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'lib'
|
||||
. PATH_SEPARATOR . $modelDir . DIRECTORY_SEPARATOR . 'cms'
|
||||
. PATH_SEPARATOR . $modelDir . DIRECTORY_SEPARATOR . 'company'
|
||||
. PATH_SEPARATOR . $modelDir . DIRECTORY_SEPARATOR . 'ecommerce'
|
||||
|
Loading…
x
Reference in New Issue
Block a user