From b173763bbb9b55d9de33e6ae8d22eb222b36d5b5 Mon Sep 17 00:00:00 2001 From: Mikhail Shamin Date: Wed, 11 May 2016 02:41:26 +0700 Subject: [PATCH] Remove full qualified class names in tests --- .../EventListener/CacheMetadataListener.php | 4 +- .../Tests/Models/DDC2504/DDC2504RootClass.php | 2 +- .../Tests/Models/DDC3293/DDC3293User.php | 2 +- .../Models/DDC3293/DDC3293UserPrefixed.php | 2 +- .../AbstractManyToManyAssociationTestCase.php | 3 +- .../Functional/AdvancedAssociationTest.php | 12 +++-- .../ORM/Functional/AdvancedDqlQueryTest.php | 3 +- .../ORM/Functional/BasicFunctionalTest.php | 43 ++++++++------- .../ORM/Functional/CascadeRemoveOrderTest.php | 3 +- .../Functional/ClassTableInheritanceTest.php | 8 +-- .../Functional/ClassTableInheritanceTest2.php | 21 +++++--- .../Tests/ORM/Functional/ClearEventTest.php | 7 +-- .../Functional/CompositePrimaryKeyTest.php | 3 +- ...ompositePrimaryKeyWithAssociationsTest.php | 3 +- .../ORM/Functional/DatabaseDriverTest.php | 19 +++---- .../ORM/Functional/DatabaseDriverTestCase.php | 5 +- .../ORM/Functional/DefaultValuesTest.php | 6 ++- .../ORM/Functional/DetachedEntityTest.php | 6 ++- .../ORM/Functional/EntityListenersTest.php | 3 +- .../EntityRepositoryCriteriaTest.php | 3 +- .../ORM/Functional/EntityRepositoryTest.php | 18 ++++--- .../Functional/ExtraLazyCollectionTest.php | 52 ++++++++++--------- .../Tests/ORM/Functional/FlushEventTest.php | 6 ++- .../Tests/ORM/Functional/IdentityMapTest.php | 14 ++--- .../ORM/Functional/IndexByAssociationTest.php | 5 +- .../ORM/Functional/LifecycleCallbackTest.php | 28 ++++++---- .../Functional/Locking/LockAgentWorker.php | 13 +++-- .../Tests/ORM/Functional/Locking/LockTest.php | 26 ++++++---- .../ManyToManyBasicAssociationTest.php | 8 +-- .../ORM/Functional/ManyToManyEventTest.php | 3 +- .../ORM/Functional/MappedSuperclassTest.php | 11 ++-- .../Functional/MergeCompositeToOneKeyTest.php | 3 +- .../Tests/ORM/Functional/NativeQueryTest.php | 8 +-- .../Tests/ORM/Functional/NewOperatorTest.php | 3 +- .../Tests/ORM/Functional/NotifyPolicyTest.php | 13 +++-- .../OneToManyBidirectionalAssociationTest.php | 3 +- .../Functional/OneToManyOrphanRemovalTest.php | 3 +- ...neToManySelfReferentialAssociationTest.php | 3 +- ...OneToManyUnidirectionalAssociationTest.php | 3 +- .../OneToOneBidirectionalAssociationTest.php | 5 +- .../Functional/OneToOneEagerLoadingTest.php | 9 ++-- .../Functional/OneToOneOrphanRemovalTest.php | 3 +- ...OneToOneSelfReferentialAssociationTest.php | 3 +- .../OneToOneUnidirectionalAssociationTest.php | 3 +- .../ORM/Functional/OrderedCollectionTest.php | 3 +- ...edJoinedTableInheritanceCollectionTest.php | 6 ++- .../Tests/ORM/Functional/PaginationTest.php | 3 +- .../PersistentCollectionCriteriaTest.php | 3 +- .../Functional/PersistentCollectionTest.php | 6 ++- .../ORM/Functional/PersistentObjectTest.php | 3 +- .../ORM/Functional/PostFlushEventTest.php | 3 +- .../ORM/Functional/PostLoadEventTest.php | 3 +- .../Tests/ORM/Functional/QueryCacheTest.php | 3 +- .../ORM/Functional/QueryDqlFunctionTest.php | 3 +- .../Tests/ORM/Functional/QueryTest.php | 10 ++-- .../Tests/ORM/Functional/ReadOnlyTest.php | 3 +- .../ORM/Functional/ReferenceProxyTest.php | 8 +-- .../Tests/ORM/Functional/ResultCacheTest.php | 9 ++-- .../Tests/ORM/Functional/SQLFilterTest.php | 14 ++--- .../SchemaTool/CompanySchemaTest.php | 3 +- .../ORM/Functional/SchemaTool/DBAL483Test.php | 3 +- .../ORM/Functional/SchemaTool/DDC214Test.php | 6 ++- .../SchemaTool/PostgreSqlSchemaToolTest.php | 3 +- .../ORM/Functional/SchemaValidatorTest.php | 3 +- .../SecondLevelCacheConcurrentTest.php | 6 ++- .../SecondLevelCacheQueryCacheTest.php | 3 +- .../SequenceEmulatedIdentityStrategyTest.php | 3 +- .../ORM/Functional/SequenceGeneratorTest.php | 3 +- .../Functional/SingleTableInheritanceTest.php | 27 ++++++---- .../StandardEntityPersisterTest.php | 5 +- .../ORM/Functional/Ticket/DDC1050Test.php | 2 +- .../ORM/Functional/Ticket/DDC1080Test.php | 2 +- .../ORM/Functional/Ticket/DDC1643Test.php | 2 +- .../ORM/Functional/Ticket/DDC1707Test.php | 8 +-- .../ORM/Functional/Ticket/DDC1778Test.php | 4 +- .../ORM/Functional/Ticket/DDC331Test.php | 2 +- .../ORM/Functional/Ticket/DDC656Test.php | 4 +- .../ORM/Functional/Ticket/DDC758Test.php | 2 +- .../Tests/ORM/Functional/TypeTest.php | 3 +- .../Tests/ORM/Functional/TypeValueSqlTest.php | 3 +- .../ORM/Functional/UUIDGeneratorTest.php | 3 +- .../Functional/UnitOfWorkLifecycleTest.php | 3 +- .../Tests/ORM/Functional/ValueObjectsTest.php | 3 +- .../ORM/Functional/VersionedOneToOneTest.php | 3 +- tests/Doctrine/Tests/ORM/Query/ExprTest.php | 26 +++++----- .../ORM/Query/LanguageRecognitionTest.php | 2 +- tests/Doctrine/Tests/ORM/Query/QueryTest.php | 4 +- tests/Doctrine/Tests/ORM/QueryBuilderTest.php | 10 ++-- .../GenerateRepositoriesCommandTest.php | 2 +- .../Tools/EntityRepositoryGeneratorTest.php | 2 +- .../Pagination/CountOutputWalkerTest.php | 6 +-- .../ORM/Tools/Pagination/CountWalkerTest.php | 12 ++--- .../LimitSubqueryOutputWalkerTest.php | 22 ++++---- .../Pagination/LimitSubqueryWalkerTest.php | 10 ++-- .../Tools/Pagination/WhereInWalkerTest.php | 18 +++---- 95 files changed, 417 insertions(+), 290 deletions(-) diff --git a/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php b/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php index 7a7caf18edc..f27e38c4779 100644 --- a/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php +++ b/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php @@ -40,7 +40,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $event) * * @return bool */ - private function isVisited(ClassMetaData $metadata) + private function isVisited(ClassMetadata $metadata) { return isset($this->enabledItems[$metadata->getName()]); } @@ -48,7 +48,7 @@ private function isVisited(ClassMetaData $metadata) /** * @param ClassMetadata $metadata */ - private function recordVisit(ClassMetaData $metadata) + private function recordVisit(ClassMetadata $metadata) { $this->enabledItems[$metadata->getName()] = true; } diff --git a/tests/Doctrine/Tests/Models/DDC2504/DDC2504RootClass.php b/tests/Doctrine/Tests/Models/DDC2504/DDC2504RootClass.php index 18edd75a306..22828b0164b 100644 --- a/tests/Doctrine/Tests/Models/DDC2504/DDC2504RootClass.php +++ b/tests/Doctrine/Tests/Models/DDC2504/DDC2504RootClass.php @@ -20,7 +20,7 @@ class DDC2504RootClass public $id; /** - * @var Doctrine\Tests\Models\DDC\DDC2504OtherClass + * @var \Doctrine\Tests\Models\DDC2504\DDC2504OtherClass * * @ManyToOne(targetEntity="DDC2504OtherClass", inversedBy="childClasses") */ diff --git a/tests/Doctrine/Tests/Models/DDC3293/DDC3293User.php b/tests/Doctrine/Tests/Models/DDC3293/DDC3293User.php index 25ed140eab1..4df5f9b68c8 100644 --- a/tests/Doctrine/Tests/Models/DDC3293/DDC3293User.php +++ b/tests/Doctrine/Tests/Models/DDC3293/DDC3293User.php @@ -10,7 +10,7 @@ class DDC3293User protected $id; /** - * @var Doctrine\Tests\Models\DDC3293\DDC3293Address + * @var \Doctrine\Tests\Models\DDC3293\DDC3293Address */ protected $address; } diff --git a/tests/Doctrine/Tests/Models/DDC3293/DDC3293UserPrefixed.php b/tests/Doctrine/Tests/Models/DDC3293/DDC3293UserPrefixed.php index a70b26756a6..d83da15afad 100644 --- a/tests/Doctrine/Tests/Models/DDC3293/DDC3293UserPrefixed.php +++ b/tests/Doctrine/Tests/Models/DDC3293/DDC3293UserPrefixed.php @@ -10,7 +10,7 @@ class DDC3293UserPrefixed protected $id; /** - * @var Doctrine\Tests\Models\DDC3293\DDC3293Address + * @var \Doctrine\Tests\Models\DDC3293\DDC3293Address */ protected $address; } diff --git a/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php b/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php index d6dd12e8b95..37f0fcd2982 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php +++ b/tests/Doctrine/Tests/ORM/Functional/AbstractManyToManyAssociationTestCase.php @@ -3,11 +3,12 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Common\Collections\Collection; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Base class for testing a many-to-many association mapping (without inheritance). */ -class AbstractManyToManyAssociationTestCase extends \Doctrine\Tests\OrmFunctionalTestCase +class AbstractManyToManyAssociationTestCase extends OrmFunctionalTestCase { protected $_firstField; protected $_secondField; diff --git a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php index 6847d01c356..5546b285e86 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php @@ -2,14 +2,16 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Query; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Functional tests for the Single Table Inheritance mapping strategy. * * @author robo */ -class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class AdvancedAssociationTest extends OrmFunctionalTestCase { protected function setUp() { parent::setUp(); @@ -151,7 +153,7 @@ class Lemma { private $types; public function __construct() { - $this->types = new \Doctrine\Common\Collections\ArrayCollection(); + $this->types = new ArrayCollection(); } @@ -257,7 +259,7 @@ class Type { private $lemmas; public function __construct(){ - $this->lemmas = new \Doctrine\Common\Collections\ArrayCollection(); + $this->lemmas = new ArrayCollection(); } /** @@ -372,7 +374,7 @@ class Phrase { private $definitions; public function __construct() { - $this->definitions = new \Doctrine\Common\Collections\ArrayCollection; + $this->definitions = new ArrayCollection; } /** @@ -464,7 +466,7 @@ class PhraseType { private $phrases; public function __construct() { - $this->phrases = new \Doctrine\Common\Collections\ArrayCollection; + $this->phrases = new ArrayCollection; } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php b/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php index 67038a7818f..a7c35412b52 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php @@ -5,13 +5,14 @@ use Doctrine\Tests\Models\Company\CompanyEmployee, Doctrine\Tests\Models\Company\CompanyManager, Doctrine\Tests\Models\Company\CompanyCar; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Functional Query tests. * * @author Benjamin */ -class AdvancedDqlQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase +class AdvancedDqlQueryTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php index 42a75be140b..2046d59a03b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php @@ -2,14 +2,19 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\DBAL\Logging\DebugStack; +use Doctrine\ORM\EntityNotFoundException; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query; +use Doctrine\ORM\UnitOfWork; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\CMS\CmsPhonenumber; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsArticle; use Doctrine\Tests\Models\CMS\CmsComment; +use Doctrine\Tests\OrmFunctionalTestCase; -class BasicFunctionalTest extends \Doctrine\Tests\OrmFunctionalTestCase +class BasicFunctionalTest extends OrmFunctionalTestCase { protected function setUp() { @@ -65,9 +70,9 @@ public function testBasicUnitsOfWorkWithOneToManyAssociation() $this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($user)); $this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($ph)); $this->assertFalse($this->_em->getUnitOfWork()->isScheduledForDelete($ph2)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph2)); + $this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user)); + $this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph)); + $this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($ph2)); } public function testOneToManyAssociationModification() @@ -146,15 +151,15 @@ public function testRemove() $user->username = 'gblanco'; $user->status = 'developer'; - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); + $this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); $this->_em->persist($user); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_MANAGED"); + $this->assertEquals(UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_MANAGED"); $this->_em->remove($user); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); + $this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); $this->_em->persist($user); $this->_em->flush(); @@ -162,10 +167,10 @@ public function testRemove() $this->_em->remove($user); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_REMOVED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_REMOVED"); + $this->assertEquals(UnitOfWork::STATE_REMOVED, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_REMOVED"); $this->_em->flush(); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); + $this->assertEquals(UnitOfWork::STATE_NEW, $this->_em->getUnitOfWork()->getEntityState($user), "State should be UnitOfWork::STATE_NEW"); $this->assertNull($this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $id)); } @@ -565,7 +570,7 @@ public function testTextColumnSaveAndRetrieve() $this->_em->persist($user); - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article = new CmsArticle(); $article->text = "Lorem ipsum dolor sunt."; $article->topic = "A Test Article!"; $article->setAuthor($user); @@ -608,7 +613,7 @@ public function testFlushDoesNotIssueUnnecessaryUpdates() $address->user = $user; $user->address = $address; - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article = new CmsArticle(); $article->text = "Lorem ipsum dolor sunt."; $article->topic = "A Test Article!"; $article->setAuthor($user); @@ -628,7 +633,7 @@ public function testFlushDoesNotIssueUnnecessaryUpdates() $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsAddress', $user2->address); $oldLogger = $this->_em->getConnection()->getConfiguration()->getSQLLogger(); - $debugStack = new \Doctrine\DBAL\Logging\DebugStack; + $debugStack = new DebugStack(); $this->_em->getConnection()->getConfiguration()->setSQLLogger($debugStack); $this->_em->flush(); @@ -938,7 +943,7 @@ public function testMergeThrowsExceptionIfEntityWithGeneratedIdentifierDoesNotEx try { $this->_em->merge($user); $this->fail(); - } catch (\Doctrine\ORM\EntityNotFoundException $enfe) {} + } catch (EntityNotFoundException $enfe) {} } /** @@ -995,7 +1000,7 @@ public function testManyToOneFetchModeQuery() $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.id = ?1"; $article = $this->_em->createQuery($dql) ->setParameter(1, $article->id) - ->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', \Doctrine\ORM\Mapping\ClassMetadata::FETCH_EAGER) + ->setFetchMode('Doctrine\Tests\Models\CMS\CmsArticle', 'user', ClassMetadata::FETCH_EAGER) ->getSingleResult(); $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $article->user, "It IS a proxy, ..."); $this->assertTrue($article->user->__isInitialized__, "...but its initialized!"); @@ -1041,14 +1046,14 @@ public function testClearWithEntityName() $this->_em->clear('Doctrine\Tests\Models\CMS\CmsUser'); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($user)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article1)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article2)); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $unitOfWork->getEntityState($address)); + $this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($user)); + $this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article1)); + $this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($article2)); + $this->assertEquals(UnitOfWork::STATE_MANAGED, $unitOfWork->getEntityState($address)); $this->_em->clear(); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($address)); + $this->assertEquals(UnitOfWork::STATE_DETACHED, $unitOfWork->getEntityState($address)); } public function testFlushManyExplicitEntities() diff --git a/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php b/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php index 9fd1648e083..a2392a3e86d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php @@ -3,11 +3,12 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @group CascadeRemoveOrderTest */ -class CascadeRemoveOrderTest extends \Doctrine\Tests\OrmFunctionalTestCase +class CascadeRemoveOrderTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php index f8dd3b7a582..697f568ffb5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php @@ -10,15 +10,17 @@ Doctrine\Tests\Models\Company\CompanyRaffle; use Doctrine\Common\Collections\Criteria; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Functional tests for the Class Table Inheritance mapping strategy. * * @author robo */ -class ClassTableInheritanceTest extends \Doctrine\Tests\OrmFunctionalTestCase +class ClassTableInheritanceTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() + { $this->useModelSet('company'); parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); @@ -80,7 +82,7 @@ public function testCRUD() $query->setParameter(1, 'NewName', 'string'); $query->setParameter(2, 'NewDepartment'); $query->setParameter(3, 100000); - $query->getSql(); + $query->getSQL(); $numUpdated = $query->execute(); $this->assertEquals(1, $numUpdated); diff --git a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php index 9c50a1496da..5682bffe108 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php @@ -1,15 +1,18 @@ _schemaTool->createSchema(array( @@ -156,19 +159,23 @@ class CTIRelated2 private $ctiChildren; - public function __construct() { - $this->ctiChildren = new \Doctrine\Common\Collections\ArrayCollection; + public function __construct() + { + $this->ctiChildren = new ArrayCollection(); } - public function getId() { + public function getId() + { return $this->id; } - public function addCTIChild(CTIChild $child) { + public function addCTIChild(CTIChild $child) + { $this->ctiChildren->add($child); } - public function getCTIChildren() { + public function getCTIChildren() + { return $this->ctiChildren; } } diff --git a/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php b/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php index 389b09a54bb..8c234c0f3f3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClearEventTest.php @@ -4,18 +4,15 @@ use Doctrine\ORM\Event\OnClearEventArgs; use Doctrine\ORM\Events; +use Doctrine\Tests\OrmFunctionalTestCase; /** * ClearEventTest * * @author Michael Ridgway */ -class ClearEventTest extends \Doctrine\Tests\OrmFunctionalTestCase +class ClearEventTest extends OrmFunctionalTestCase { - protected function setUp() { - parent::setUp(); - } - public function testEventIsCalledOnClear() { $listener = new OnClearListener; diff --git a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php index 2e1cedb3917..835328d7503 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php @@ -6,8 +6,9 @@ use Doctrine\Tests\Models\Navigation\NavTour; use Doctrine\Tests\Models\Navigation\NavPhotos; use Doctrine\Tests\Models\Navigation\NavUser; +use Doctrine\Tests\OrmFunctionalTestCase; -class CompositePrimaryKeyTest extends \Doctrine\Tests\OrmFunctionalTestCase +class CompositePrimaryKeyTest extends OrmFunctionalTestCase { public function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php index 6ded5bb494e..b735925e63f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php @@ -5,8 +5,9 @@ use Doctrine\Tests\Models\GeoNames\Country; use Doctrine\Tests\Models\GeoNames\Admin1; use Doctrine\Tests\Models\GeoNames\Admin1AlternateName; +use Doctrine\Tests\OrmFunctionalTestCase; -class CompositePrimaryKeyWithAssociationsTest extends \Doctrine\Tests\OrmFunctionalTestCase +class CompositePrimaryKeyWithAssociationsTest extends OrmFunctionalTestCase { public function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php index 29d71856016..37149abfd3a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php @@ -3,6 +3,7 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\DBAL\Platforms\SQLServerPlatform; +use Doctrine\DBAL\Schema\Table; use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\DBAL\Platforms\PostgreSqlPlatform; @@ -30,10 +31,10 @@ public function testIssue2059() $this->markTestSkipped('Platform does not support foreign keys.'); } - $user = new \Doctrine\DBAL\Schema\Table("ddc2059_user"); + $user = new Table("ddc2059_user"); $user->addColumn('id', 'integer'); $user->setPrimaryKey(array('id')); - $project = new \Doctrine\DBAL\Schema\Table("ddc2059_project"); + $project = new Table("ddc2059_project"); $project->addColumn('id', 'integer'); $project->addColumn('user_id', 'integer'); $project->addColumn('user', 'string'); @@ -52,7 +53,7 @@ public function testLoadMetadataFromDatabase() $this->markTestSkipped('Platform does not support foreign keys.'); } - $table = new \Doctrine\DBAL\Schema\Table("dbdriver_foo"); + $table = new Table("dbdriver_foo"); $table->addColumn('id', 'integer'); $table->setPrimaryKey(array('id')); $table->addColumn('bar', 'string', array('notnull' => false, 'length' => 200)); @@ -83,13 +84,13 @@ public function testLoadMetadataWithForeignKeyFromDatabase() $this->markTestSkipped('Platform does not support foreign keys.'); } - $tableB = new \Doctrine\DBAL\Schema\Table("dbdriver_bar"); + $tableB = new Table("dbdriver_bar"); $tableB->addColumn('id', 'integer'); $tableB->setPrimaryKey(array('id')); $this->_sm->dropAndCreateTable($tableB); - $tableA = new \Doctrine\DBAL\Schema\Table("dbdriver_baz"); + $tableA = new Table("dbdriver_baz"); $tableA->addColumn('id', 'integer'); $tableA->setPrimaryKey(array('id')); $tableA->addColumn('bar_id', 'integer'); @@ -133,15 +134,15 @@ public function testDetectManyToManyTables() public function testIgnoreManyToManyTableWithoutFurtherForeignKeyDetails() { - $tableB = new \Doctrine\DBAL\Schema\Table("dbdriver_bar"); + $tableB = new Table("dbdriver_bar"); $tableB->addColumn('id', 'integer'); $tableB->setPrimaryKey(array('id')); - $tableA = new \Doctrine\DBAL\Schema\Table("dbdriver_baz"); + $tableA = new Table("dbdriver_baz"); $tableA->addColumn('id', 'integer'); $tableA->setPrimaryKey(array('id')); - $tableMany = new \Doctrine\DBAL\Schema\Table("dbdriver_bar_baz"); + $tableMany = new Table("dbdriver_bar_baz"); $tableMany->addColumn('bar_id', 'integer'); $tableMany->addColumn('baz_id', 'integer'); $tableMany->addForeignKeyConstraint('dbdriver_bar', array('bar_id'), array('id')); @@ -157,7 +158,7 @@ public function testLoadMetadataFromDatabaseDetail() $this->markTestSkipped('Platform does not support foreign keys.'); } - $table = new \Doctrine\DBAL\Schema\Table("dbdriver_foo"); + $table = new Table("dbdriver_foo"); $table->addColumn('id', 'integer', array('unsigned' => true)); $table->setPrimaryKey(array('id')); diff --git a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php index 35fd8b20c5c..03902c40ca9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php +++ b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTestCase.php @@ -2,6 +2,7 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\ORM\Mapping\Driver\DatabaseDriver; use Doctrine\Tests\OrmFunctionalTestCase; use Doctrine\ORM\Mapping\ClassMetadataInfo; @@ -13,7 +14,7 @@ abstract class DatabaseDriverTestCase extends OrmFunctionalTestCase protected function convertToClassMetadata(array $entityTables, array $manyTables = array()) { $sm = $this->_em->getConnection()->getSchemaManager(); - $driver = new \Doctrine\ORM\Mapping\Driver\DatabaseDriver($sm); + $driver = new DatabaseDriver($sm); $driver->setTables($entityTables, $manyTables); $metadatas = array(); @@ -36,7 +37,7 @@ protected function extractClassMetadata(array $classNames) $metadatas = array(); $sm = $this->_em->getConnection()->getSchemaManager(); - $driver = new \Doctrine\ORM\Mapping\Driver\DatabaseDriver($sm); + $driver = new DatabaseDriver($sm); foreach ($driver->getAllClassNames() as $className) { if (!in_array(strtolower($className), $classNames)) { diff --git a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php index b1f7cda9c73..e81bd7f8ac1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php @@ -1,15 +1,17 @@ _schemaTool->createSchema(array( diff --git a/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php b/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php index bc6c0cdd7f2..c78d258597a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php @@ -6,15 +6,17 @@ use Doctrine\Tests\Models\CMS\CmsPhonenumber; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsArticle; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Description of DetachedEntityTest * * @author robo */ -class DetachedEntityTest extends \Doctrine\Tests\OrmFunctionalTestCase +class DetachedEntityTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() + { $this->useModelSet('cms'); parent::setUp(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php index 58479526322..89901be1969 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php @@ -3,11 +3,12 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Tests\Models\Company\CompanyFixContract; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @group DDC-1955 */ -class EntityListenersTest extends \Doctrine\Tests\OrmFunctionalTestCase +class EntityListenersTest extends OrmFunctionalTestCase { /** diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php index 6a626b3f44e..45f552d5949 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php @@ -23,11 +23,12 @@ use Doctrine\Common\Collections\Criteria; use Doctrine\Tests\Models\Tweet\Tweet; use Doctrine\Tests\Models\Tweet\User; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @author Josiah */ -class EntityRepositoryCriteriaTest extends \Doctrine\Tests\OrmFunctionalTestCase +class EntityRepositoryCriteriaTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index 8e20d570a7b..685478f35f6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -2,18 +2,22 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\DBAL\Connection; +use Doctrine\DBAL\LockMode; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\CMS\CmsEmail; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @author robo */ -class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase +class EntityRepositoryTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() + { $this->useModelSet('cms'); parent::setUp(); } @@ -290,7 +294,7 @@ public function testPessimisticReadLockWithoutTransaction_ThrowsException() $this->setExpectedException('Doctrine\ORM\TransactionRequiredException'); $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->find(1, \Doctrine\DBAL\LockMode::PESSIMISTIC_READ); + ->find(1, LockMode::PESSIMISTIC_READ); } /** @@ -302,7 +306,7 @@ public function testPessimisticWriteLockWithoutTransaction_ThrowsException() $this->setExpectedException('Doctrine\ORM\TransactionRequiredException'); $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->find(1, \Doctrine\DBAL\LockMode::PESSIMISTIC_WRITE); + ->find(1, LockMode::PESSIMISTIC_WRITE); } /** @@ -314,7 +318,7 @@ public function testOptimisticLockUnversionedEntity_ThrowsException() $this->setExpectedException('Doctrine\ORM\OptimisticLockException'); $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser') - ->find(1, \Doctrine\DBAL\LockMode::OPTIMISTIC); + ->find(1, LockMode::OPTIMISTIC); } /** @@ -335,7 +339,7 @@ public function testIdentityMappedOptimisticLockUnversionedEntity_ThrowsExceptio $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId); $this->setExpectedException('Doctrine\ORM\OptimisticLockException'); - $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId, \Doctrine\DBAL\LockMode::OPTIMISTIC); + $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $userId, LockMode::OPTIMISTIC); } /** @@ -670,7 +674,7 @@ public function testFindByAssociationArray() $query = array_pop($this->_sqlLoggerStack->queries); $this->assertEquals(array(1,2,3), $query['params'][0]); - $this->assertEquals(\Doctrine\DBAL\Connection::PARAM_INT_ARRAY, $query['types'][0]); + $this->assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index 731a0826d60..c8af5bd8546 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -3,6 +3,10 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\ORM\Mapping\ClassMetadataInfo; +use Doctrine\Tests\Models\CMS\CmsArticle; +use Doctrine\Tests\Models\CMS\CmsGroup; +use Doctrine\Tests\Models\CMS\CmsPhonenumber; +use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\DDC2504\DDC2504ChildClass; use Doctrine\Tests\Models\DDC2504\DDC2504OtherClass; use Doctrine\Tests\Models\Tweet\Tweet; @@ -99,7 +103,7 @@ public function testCountWhenNewEntityPresent() { $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $newGroup = new CmsGroup(); $newGroup->name = "Test4"; $user->addGroup($newGroup); @@ -277,7 +281,7 @@ public function testContainsOneToMany() $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); // Test One to Many existence with state new - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article = new CmsArticle(); $article->topic = "Testnew"; $article->text = "blub"; @@ -295,7 +299,7 @@ public function testContainsOneToMany() $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); // Test One to Many existence with state managed - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article = new CmsArticle(); $article->topic = "How to not fail anymore on tests"; $article->text = "That is simple! Just write more tests!"; @@ -414,7 +418,7 @@ public function testContainsManyToMany() $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); // Test Many to Many existence with state new - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $group = new CmsGroup(); $group->name = "A New group!"; $queryCount = $this->getCurrentQueryCount(); @@ -434,7 +438,7 @@ public function testContainsManyToMany() $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); // Test Many to Many existence with state managed - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $group = new CmsGroup(); $group->name = "My managed group"; $this->_em->persist($group); @@ -461,7 +465,7 @@ public function testContainsManyToManyInverse() $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - $newUser = new \Doctrine\Tests\Models\CMS\CmsUser(); + $newUser = new CmsUser(); $newUser->name = "A New group!"; $queryCount = $this->getCurrentQueryCount(); @@ -488,7 +492,7 @@ public function testRemoveElementOneToMany() $this->assertEquals($queryCount, $this->getCurrentQueryCount()); // Test One to Many removal with Entity state as new - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article = new CmsArticle(); $article->topic = "Testnew"; $article->text = "blub"; @@ -510,7 +514,7 @@ public function testRemoveElementOneToMany() $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); // Test One to Many removal with Entity state as managed - $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article = new CmsArticle(); $article->topic = "How to not fail anymore on tests"; $article->text = "That is simple! Just write more tests!"; @@ -642,7 +646,7 @@ public function testRemoveElementManyToMany() $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); // Test Many to Many removal with Entity state as new - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $group = new CmsGroup(); $group->name = "A New group!"; $queryCount = $this->getCurrentQueryCount(); @@ -664,7 +668,7 @@ public function testRemoveElementManyToMany() $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); // Test Many to Many removal with Entity state as managed - $group = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $group = new CmsGroup(); $group->name = "A New group!"; $this->_em->persist($group); @@ -693,7 +697,7 @@ public function testRemoveElementManyToManyInverse() $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a managed entity should cause one query to be executed."); $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); - $newUser = new \Doctrine\Tests\Models\CMS\CmsUser(); + $newUser = new CmsUser(); $newUser->name = "A New group!"; $queryCount = $this->getCurrentQueryCount(); @@ -711,7 +715,7 @@ public function testCountAfterAddThenFlush() { $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); - $newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $newGroup = new CmsGroup(); $newGroup->name = "Test4"; $user->addGroup($newGroup); @@ -735,7 +739,7 @@ public function testSliceOnDirtyCollection() $user = $this->_em->find('Doctrine\Tests\Models\CMS\CmsUser', $this->userId); /* @var $user CmsUser */ - $newGroup = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $newGroup = new CmsGroup(); $newGroup->name = "Test4"; $user->addGroup($newGroup); @@ -947,22 +951,22 @@ public function testContainsKeyNonExistentIndexByManyToMany() private function loadFixture() { - $user1 = new \Doctrine\Tests\Models\CMS\CmsUser(); + $user1 = new CmsUser(); $user1->username = "beberlei"; $user1->name = "Benjamin"; $user1->status = "active"; - $user2 = new \Doctrine\Tests\Models\CMS\CmsUser(); + $user2 = new CmsUser(); $user2->username = "jwage"; $user2->name = "Jonathan"; $user2->status = "active"; - $user3 = new \Doctrine\Tests\Models\CMS\CmsUser(); + $user3 = new CmsUser(); $user3->username = "romanb"; $user3->name = "Roman"; $user3->status = "active"; - $user4 = new \Doctrine\Tests\Models\CMS\CmsUser(); + $user4 = new CmsUser(); $user4->username = "gblanco"; $user4->name = "Guilherme"; $user4->status = "active"; @@ -972,13 +976,13 @@ private function loadFixture() $this->_em->persist($user3); $this->_em->persist($user4); - $group1 = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $group1 = new CmsGroup(); $group1->name = "Test1"; - $group2 = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $group2 = new CmsGroup(); $group2->name = "Test2"; - $group3 = new \Doctrine\Tests\Models\CMS\CmsGroup(); + $group3 = new CmsGroup(); $group3->name = "Test3"; $user1->addGroup($group1); @@ -993,12 +997,12 @@ private function loadFixture() $this->_em->persist($group2); $this->_em->persist($group3); - $article1 = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article1 = new CmsArticle(); $article1->topic = "Test1"; $article1->text = "Test1"; $article1->setAuthor($user1); - $article2 = new \Doctrine\Tests\Models\CMS\CmsArticle(); + $article2 = new CmsArticle(); $article2->topic = "Test2"; $article2->text = "Test2"; $article2->setAuthor($user1); @@ -1006,10 +1010,10 @@ private function loadFixture() $this->_em->persist($article1); $this->_em->persist($article2); - $phonenumber1 = new \Doctrine\Tests\Models\CMS\CmsPhonenumber(); + $phonenumber1 = new CmsPhonenumber(); $phonenumber1->phonenumber = '12345'; - $phonenumber2 = new \Doctrine\Tests\Models\CMS\CmsPhonenumber(); + $phonenumber2 = new CmsPhonenumber(); $phonenumber2->phonenumber = '67890'; $this->_em->persist($phonenumber1); diff --git a/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php b/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php index bd3a33002cf..b9298e3dc09 100644 --- a/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php @@ -6,15 +6,17 @@ use Doctrine\Tests\Models\CMS\CmsPhonenumber; use Doctrine\ORM\Event\OnFlushEventArgs; use Doctrine\ORM\Events; +use Doctrine\Tests\OrmFunctionalTestCase; /** * FlushEventTest * * @author robo */ -class FlushEventTest extends \Doctrine\Tests\OrmFunctionalTestCase +class FlushEventTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() + { $this->useModelSet('cms'); parent::setUp(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php b/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php index b79f9f3cbc6..94a11dab490 100644 --- a/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php @@ -2,10 +2,11 @@ namespace Doctrine\Tests\ORM\Functional; -use Doctrine\Tests\Models\CMS\CmsUser, - Doctrine\Tests\Models\CMS\CmsAddress, - Doctrine\Tests\Models\CMS\CmsPhonenumber, - Doctrine\ORM\Query; +use Doctrine\ORM\Query; +use Doctrine\Tests\Models\CMS\CmsAddress; +use Doctrine\Tests\Models\CMS\CmsPhonenumber; +use Doctrine\Tests\Models\CMS\CmsUser; +use Doctrine\Tests\OrmFunctionalTestCase; /** * IdentityMapTest @@ -15,9 +16,10 @@ * * @author Roman Borschel */ -class IdentityMapTest extends \Doctrine\Tests\OrmFunctionalTestCase +class IdentityMapTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() + { $this->useModelSet('cms'); parent::setUp(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php index e5a4d1d9e9d..9dac4155ded 100644 --- a/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php @@ -5,14 +5,15 @@ use Doctrine\Tests\Models\StockExchange\Stock; use Doctrine\Tests\Models\StockExchange\Market; use Doctrine\Tests\Models\StockExchange\Bond; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @group DDC-250 */ -class IndexByAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class IndexByAssociationTest extends OrmFunctionalTestCase { /** - * @var Doctrine\Tests\Models\StockExchange\Market + * @var Market */ private $market; diff --git a/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php b/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php index 9b60c43b2b7..50864592751 100644 --- a/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php @@ -1,12 +1,18 @@ _schemaTool->createSchema(array( @@ -470,7 +476,7 @@ class LifecycleCallbackCascader public function __construct() { - $this->entities = new \Doctrine\Common\Collections\ArrayCollection(); + $this->entities = new ArrayCollection(); } /** @PostLoad */ @@ -516,7 +522,7 @@ class LifecycleCallbackEventArgEntity /** * @PostPersist */ - public function postPersistHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) + public function postPersistHandler(LifecycleEventArgs $event) { $this->calls[__FUNCTION__] = $event; } @@ -524,7 +530,7 @@ public function postPersistHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event /** * @PrePersist */ - public function prePersistHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) + public function prePersistHandler(LifecycleEventArgs $event) { $this->calls[__FUNCTION__] = $event; } @@ -532,7 +538,7 @@ public function prePersistHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) /** * @PostUpdate */ - public function postUpdateHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) + public function postUpdateHandler(LifecycleEventArgs $event) { $this->calls[__FUNCTION__] = $event; } @@ -540,7 +546,7 @@ public function postUpdateHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) /** * @PreUpdate */ - public function preUpdateHandler(\Doctrine\ORM\Event\PreUpdateEventArgs $event) + public function preUpdateHandler(PreUpdateEventArgs $event) { $this->calls[__FUNCTION__] = $event; } @@ -548,7 +554,7 @@ public function preUpdateHandler(\Doctrine\ORM\Event\PreUpdateEventArgs $event) /** * @PostRemove */ - public function postRemoveHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) + public function postRemoveHandler(LifecycleEventArgs $event) { $this->calls[__FUNCTION__] = $event; } @@ -556,7 +562,7 @@ public function postRemoveHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) /** * @PreRemove */ - public function preRemoveHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) + public function preRemoveHandler(LifecycleEventArgs $event) { $this->calls[__FUNCTION__] = $event; } @@ -564,7 +570,7 @@ public function preRemoveHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) /** * @PreFlush */ - public function preFlushHandler(\Doctrine\ORM\Event\PreFlushEventArgs $event) + public function preFlushHandler(PreFlushEventArgs $event) { $this->calls[__FUNCTION__] = $event; } @@ -572,7 +578,7 @@ public function preFlushHandler(\Doctrine\ORM\Event\PreFlushEventArgs $event) /** * @PostLoad */ - public function postLoadHandler(\Doctrine\ORM\Event\LifecycleEventArgs $event) + public function postLoadHandler(LifecycleEventArgs $event) { $this->calls[__FUNCTION__] = $event; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php b/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php index 4cd8dfec0e7..0ca10460f80 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php @@ -2,6 +2,11 @@ namespace Doctrine\Tests\ORM\Functional\Locking; +use Doctrine\Common\Cache\ArrayCache; +use Doctrine\DBAL\Logging\EchoSQLLogger; +use Doctrine\ORM\Configuration; +use Doctrine\ORM\EntityManager; + class LockAgentWorker { private $em; @@ -88,7 +93,7 @@ protected function processWorkload($job) protected function createEntityManager($conn) { - $config = new \Doctrine\ORM\Configuration(); + $config = new Configuration(); $config->setProxyDir(__DIR__ . '/../../../Proxies'); $config->setProxyNamespace('MyProject\Proxies'); $config->setAutoGenerateProxyClasses(true); @@ -96,12 +101,12 @@ protected function createEntityManager($conn) $annotDriver = $config->newDefaultAnnotationDriver(array(__DIR__ . '/../../../Models/'), true); $config->setMetadataDriverImpl($annotDriver); - $cache = new \Doctrine\Common\Cache\ArrayCache(); + $cache = new ArrayCache(); $config->setMetadataCacheImpl($cache); $config->setQueryCacheImpl($cache); - $config->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger()); + $config->setSQLLogger(new EchoSQLLogger()); - $em = \Doctrine\ORM\EntityManager::create($conn, $config); + $em = EntityManager::create($conn, $config); return $em; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php b/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php index 1face5f3115..e3c3b5b5c93 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php @@ -2,15 +2,19 @@ namespace Doctrine\Tests\ORM\Functional\Locking; -use Doctrine\Tests\Models\CMS\CmsArticle, - Doctrine\Tests\Models\CMS\CmsUser, - Doctrine\DBAL\LockMode; +use Doctrine\DBAL\LockMode; +use Doctrine\ORM\Query; +use Doctrine\Tests\Models\CMS\CmsArticle; +use Doctrine\Tests\Models\CMS\CmsUser; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @group locking */ -class LockTest extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() { +class LockTest extends OrmFunctionalTestCase +{ + protected function setUp() + { $this->useModelSet('cms'); parent::setUp(); $this->handles = array(); @@ -111,8 +115,9 @@ public function testLockPessimisticWrite_NoTransaction_ThrowsException() { * @group DDC-178 * @group locking */ - public function testLockPessimisticWrite() { - $writeLockSql = $this->_em->getConnection()->getDatabasePlatform()->getWriteLockSql(); + public function testLockPessimisticWrite() + { + $writeLockSql = $this->_em->getConnection()->getDatabasePlatform()->getWriteLockSQL(); if (strlen($writeLockSql) == 0) { $this->markTestSkipped('Database Driver has no Write Lock support.'); } @@ -141,8 +146,9 @@ public function testLockPessimisticWrite() { /** * @group DDC-178 */ - public function testLockPessimisticRead() { - $readLockSql = $this->_em->getConnection()->getDatabasePlatform()->getReadLockSql(); + public function testLockPessimisticRead() + { + $readLockSql = $this->_em->getConnection()->getDatabasePlatform()->getReadLockSQL(); if (strlen($readLockSql) == 0) { $this->markTestSkipped('Database Driver has no Write Lock support.'); } @@ -177,7 +183,7 @@ public function testLockOptimisticNonVersionedThrowsExceptionInDQL() $this->setExpectedException('Doctrine\ORM\OptimisticLockException', 'The optimistic lock on an entity failed.'); $sql = $this->_em->createQuery($dql)->setHint( - \Doctrine\ORM\Query::HINT_LOCK_MODE, \Doctrine\DBAL\LockMode::OPTIMISTIC + Query::HINT_LOCK_MODE, LockMode::OPTIMISTIC )->getSQL(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php index da4d3007739..2d051b68831 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php @@ -3,10 +3,12 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Common\Collections\Criteria; +use Doctrine\ORM\UnitOfWork; use Doctrine\Tests\Models\CMS\CmsTag; use Doctrine\Tests\Models\CMS\CmsUser, Doctrine\Tests\Models\CMS\CmsGroup, Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Basic many-to-many association tests. @@ -14,7 +16,7 @@ * * @author robo */ -class ManyToManyBasicAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class ManyToManyBasicAssociationTest extends OrmFunctionalTestCase { protected function setUp() { @@ -53,8 +55,8 @@ public function testBasicManyToManyJoin() $groups = $result[0]->getGroups(); $this->assertEquals('Developers_0', $groups[0]->getName()); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($result[0])); - $this->assertEquals(\Doctrine\ORM\UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($groups[0])); + $this->assertEquals(UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($result[0])); + $this->assertEquals(UnitOfWork::STATE_MANAGED, $this->_em->getUnitOfWork()->getEntityState($groups[0])); $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $groups); $this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $groups[0]->getUsers()); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php index 105ba095c03..87283ec4bf1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php @@ -5,13 +5,14 @@ use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\CMS\CmsGroup; use Doctrine\ORM\Events; +use Doctrine\Tests\OrmFunctionalTestCase; /** * ManyToManyEventTest * * @author Francisco Facioni */ -class ManyToManyEventTest extends \Doctrine\Tests\OrmFunctionalTestCase +class ManyToManyEventTest extends OrmFunctionalTestCase { /** * @var PostUpdateListener diff --git a/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php b/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php index 70034076611..fb7f0a7249d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php @@ -1,13 +1,16 @@ useModelSet('directorytree'); @@ -16,15 +19,15 @@ protected function setUp() { public function testCRUD() { - $root = new \Doctrine\Tests\Models\DirectoryTree\Directory(); + $root = new Directory(); $root->setName('Root'); $root->setPath('/root'); - $directory = new \Doctrine\Tests\Models\DirectoryTree\Directory($root); + $directory = new Directory($root); $directory->setName('TestA'); $directory->setPath('/root/dir'); - $file = new \Doctrine\Tests\Models\DirectoryTree\File($directory); + $file = new File($directory); $file->setName('test-b.html'); $this->_em->persist($root); diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php index 6c619852016..9b3b338a083 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php @@ -4,8 +4,9 @@ use Doctrine\Tests\Models\MixedToOneIdentity\CompositeToOneKeyState; use Doctrine\Tests\Models\MixedToOneIdentity\Country; +use Doctrine\Tests\OrmFunctionalTestCase; -class MergeCompositeToOneKeyTest extends \Doctrine\Tests\OrmFunctionalTestCase +class MergeCompositeToOneKeyTest extends OrmFunctionalTestCase { /** * {@inheritDoc} diff --git a/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php b/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php index 28184650357..6c460684dd2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php @@ -13,17 +13,19 @@ use Doctrine\Tests\Models\CMS\CmsEmail; use Doctrine\Tests\Models\Company\CompanyEmployee; use Doctrine\Tests\Models\Company\CompanyPerson; +use Doctrine\Tests\OrmFunctionalTestCase; /** * NativeQueryTest * * @author robo */ -class NativeQueryTest extends \Doctrine\Tests\OrmFunctionalTestCase +class NativeQueryTest extends OrmFunctionalTestCase { private $platform = null; - protected function setUp() { + protected function setUp() + { $this->useModelSet('cms'); $this->useModelSet('company'); parent::setUp(); @@ -197,7 +199,7 @@ public function testFluentInterface() $rsm = new ResultSetMapping; $q = $this->_em->createNativeQuery('SELECT id, name, status, phonenumber FROM cms_users INNER JOIN cms_phonenumbers ON id = user_id WHERE username = ?', $rsm); - $q2 = $q->setSql('foo', $rsm) + $q2 = $q->setSQL('foo') ->setResultSetMapping($rsm) ->expireResultCache(true) ->setHint('foo', 'bar') diff --git a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php index e8c0e300fa9..37067aec075 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php @@ -7,11 +7,12 @@ use Doctrine\Tests\Models\CMS\CmsEmail; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsPhonenumber; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @group DDC-1574 */ -class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase +class NewOperatorTest extends OrmFunctionalTestCase { /** * @var array diff --git a/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php b/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php index ab6aa61cfba..ecebc28d9e3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php @@ -1,18 +1,21 @@ _schemaTool->createSchema(array( diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php index c904a147400..8327142fda6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php @@ -5,11 +5,12 @@ use Doctrine\Tests\Models\ECommerce\ECommerceProduct; use Doctrine\Tests\Models\ECommerce\ECommerceFeature; use Doctrine\Common\Collections\Criteria; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a bidirectional one-to-one association mapping (without inheritance). */ -class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToManyBidirectionalAssociationTest extends OrmFunctionalTestCase { private $product; private $firstFeature; diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php index 345d6190cba..d22dbd4e2c3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php @@ -4,11 +4,12 @@ use Doctrine\Tests\Models\CMS\CmsUser, Doctrine\Tests\Models\CMS\CmsPhonenumber; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a bidirectional one-to-many association mapping with orphan removal. */ -class OneToManyOrphanRemovalTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToManyOrphanRemovalTest extends OrmFunctionalTestCase { protected $userId; diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php index ab077fe4a45..3d6c688bd2e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php @@ -5,11 +5,12 @@ use Doctrine\Tests\Models\ECommerce\ECommerceCategory; use Doctrine\ORM\Mapping\AssociationMapping; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a bidirectional one-to-one association mapping (without inheritance). */ -class OneToManySelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToManySelfReferentialAssociationTest extends OrmFunctionalTestCase { private $parent; private $firstChild; diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php index b4db3b90ed7..e2c66311817 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php @@ -5,11 +5,12 @@ use Doctrine\Tests\Models\Routing\RoutingRoute; use Doctrine\Tests\Models\Routing\RoutingLocation; use Doctrine\Tests\Models\Routing\RoutingLeg; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a bidirectional one-to-one association mapping (without inheritance). */ -class OneToManyUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToManyUnidirectionalAssociationTest extends OrmFunctionalTestCase { protected $locations = array(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php index 4ecfd5f9018..6d42e76348d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php @@ -6,11 +6,12 @@ use Doctrine\Tests\Models\ECommerce\ECommerceCustomer; use Doctrine\ORM\Mapping\AssociationMapping; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a bidirectional one-to-one association mapping (without inheritance). */ -class OneToOneBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToOneBidirectionalAssociationTest extends OrmFunctionalTestCase { private $customer; private $cart; @@ -88,7 +89,7 @@ public function testInverseSideIsNeverLazy() $customer = $result[0]; $this->assertNull($customer->getMentor()); - $this->assertInstanceOF('Doctrine\Tests\Models\ECommerce\ECommerceCart', $customer->getCart()); + $this->assertInstanceOf('Doctrine\Tests\Models\ECommerce\ECommerceCart', $customer->getCart()); $this->assertNotInstanceOf('Doctrine\ORM\Proxy\Proxy', $customer->getCart()); $this->assertEquals('paypal', $customer->getCart()->getPayment()); } diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php index fb6ed5ab76d..522a009eba8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php @@ -1,16 +1,19 @@ _em); + $schemaTool = new SchemaTool($this->_em); try { $schemaTool->createSchema(array( $this->_em->getClassMetadata('Doctrine\Tests\ORM\Functional\Train'), @@ -248,7 +251,7 @@ class Train public function __construct(TrainOwner $owner) { - $this->waggons = new \Doctrine\Common\Collections\ArrayCollection(); + $this->waggons = new ArrayCollection(); $this->setOwner($owner); } diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php index 528bf56b3c6..34bbc8c55b9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php @@ -5,11 +5,12 @@ use Doctrine\Tests\Models\CMS\CmsUser, Doctrine\Tests\Models\CMS\CmsEmail, Doctrine\Tests\Models\CMS\CmsAddress; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a bidirectional one-to-one association mapping with orphan removal. */ -class OneToOneOrphanRemovalTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToOneOrphanRemovalTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php index 4d173f3dce6..cad28d4c3c1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php @@ -5,6 +5,7 @@ use Doctrine\Tests\Models\ECommerce\ECommerceCustomer; use Doctrine\ORM\Mapping\AssociationMapping; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a self referential one-to-one association mapping (without inheritance). @@ -13,7 +14,7 @@ * for receiving support. * Inverse side is not present. */ -class OneToOneSelfReferentialAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToOneSelfReferentialAssociationTest extends OrmFunctionalTestCase { private $customer; private $mentor; diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php index 61bb8c611a2..60b5b36567b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php @@ -7,12 +7,13 @@ use Doctrine\ORM\Mapping\AssociationMapping; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests a unidirectional one-to-one association mapping (without inheritance). * Inverse side is not present. */ -class OneToOneUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OneToOneUnidirectionalAssociationTest extends OrmFunctionalTestCase { private $product; private $shipping; diff --git a/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php index d85357bac58..c4e5dca7018 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php @@ -6,8 +6,9 @@ use Doctrine\Tests\Models\Routing\RoutingLocation; use Doctrine\Tests\Models\Routing\RoutingLeg; use Doctrine\Tests\Models\Routing\RoutingRouteBooking; +use Doctrine\Tests\OrmFunctionalTestCase; -class OrderedCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OrderedCollectionTest extends OrmFunctionalTestCase { protected $locations = array(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php index cef4645744e..b3d85340e97 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php @@ -3,15 +3,17 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\ORM\Query; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Functional tests for the Single Table Inheritance mapping strategy. * * @author Benjamin Eberlei */ -class OrderedJoinedTableInheritanceCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase +class OrderedJoinedTableInheritanceCollectionTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() + { parent::setUp(); try { $this->_schemaTool->createSchema(array( diff --git a/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php b/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php index eea2e8375cd..07c3d664a89 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php @@ -13,12 +13,13 @@ use Doctrine\Tests\Models\Pagination\Department; use Doctrine\Tests\Models\Pagination\Logo; use Doctrine\Tests\Models\Pagination\User1; +use Doctrine\Tests\OrmFunctionalTestCase; use ReflectionMethod; /** * @group DDC-1613 */ -class PaginationTest extends \Doctrine\Tests\OrmFunctionalTestCase +class PaginationTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php index b6e58246f85..e38574b7c80 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php @@ -23,11 +23,12 @@ use Doctrine\Tests\Models\Quote\User as QuoteUser; use Doctrine\Tests\Models\Tweet\Tweet; use Doctrine\Tests\Models\Tweet\User as TweetUser; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @author Michaël Gallego */ -class PersistentCollectionCriteriaTest extends \Doctrine\Tests\OrmFunctionalTestCase +class PersistentCollectionCriteriaTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php index c2181b8b119..c6cb20e236d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php @@ -2,12 +2,14 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Persistence\PersistentObject; +use Doctrine\Tests\OrmFunctionalTestCase; /** */ -class PersistentCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase +class PersistentCollectionTest extends OrmFunctionalTestCase { protected function setUp() { @@ -114,7 +116,7 @@ class PersistentCollectionHolder extends PersistentObject public function __construct() { - $this->collection = new \Doctrine\Common\Collections\ArrayCollection(); + $this->collection = new ArrayCollection(); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php index 88e54ae2e5d..861b2922510 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php @@ -3,6 +3,7 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Common\Persistence\PersistentObject; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Test that Doctrine ORM correctly works with the ObjectManagerAware and PersistentObject @@ -10,7 +11,7 @@ * * @group DDC-1448 */ -class PersistentObjectTest extends \Doctrine\Tests\OrmFunctionalTestCase +class PersistentObjectTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php b/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php index e23038e6978..12e2c40809d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php @@ -5,13 +5,14 @@ use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\ORM\Event\PostFlushEventArgs; use Doctrine\ORM\Events; +use Doctrine\Tests\OrmFunctionalTestCase; /** * PostFlushEventTest * * @author Daniel Freudenberger */ -class PostFlushEventTest extends \Doctrine\Tests\OrmFunctionalTestCase +class PostFlushEventTest extends OrmFunctionalTestCase { /** * @var PostFlushListener diff --git a/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php b/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php index 9dcff9cb65b..7a5adbe7add 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php @@ -8,13 +8,14 @@ use Doctrine\Tests\Models\CMS\CmsEmail; use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Events; +use Doctrine\Tests\OrmFunctionalTestCase; /** * PostLoadEventTest * * @author Guilherme Blanco */ -class PostLoadEventTest extends \Doctrine\Tests\OrmFunctionalTestCase +class PostLoadEventTest extends OrmFunctionalTestCase { /** * @var integer diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php index f84147374c5..c6d3ebe1028 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php @@ -3,13 +3,14 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Common\Cache\ArrayCache; +use Doctrine\Tests\OrmFunctionalTestCase; /** * QueryCacheTest * * @author robo */ -class QueryCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase +class QueryCacheTest extends OrmFunctionalTestCase { /** * @var \ReflectionProperty diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php index b0a4905ac33..764b213dde2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php @@ -3,13 +3,14 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Tests\Models\Company\CompanyManager; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Functional Query tests. * * @author robo */ -class QueryDqlFunctionTest extends \Doctrine\Tests\OrmFunctionalTestCase +class QueryDqlFunctionTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php index 922c463a90b..ea150e7b2b7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php @@ -4,19 +4,21 @@ use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\ORM\UnexpectedResultException; use Doctrine\Tests\Models\CMS\CmsUser, Doctrine\Tests\Models\CMS\CmsArticle, Doctrine\Tests\Models\CMS\CmsPhonenumber; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query; use Doctrine\ORM\Query\Parameter; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Functional Query tests. * * @author robo */ -class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase +class QueryTest extends OrmFunctionalTestCase { protected function setUp() { @@ -390,7 +392,7 @@ public function testSupportsQueriesWithEntityNamespaces() try { $query = $this->_em->createQuery('UPDATE CMS:CmsUser u SET u.name = ?1'); - $this->assertEquals('UPDATE cms_users SET name = ?', $query->getSql()); + $this->assertEquals('UPDATE cms_users SET name = ?', $query->getSQL()); $query->free(); } catch (\Exception $e) { $this->fail($e->getMessage()); @@ -753,7 +755,7 @@ public function testUnexpectedResultException() try { $this->_em->createQuery($dql)->getSingleResult(); $this->fail('Expected exception "\Doctrine\ORM\NoResultException".'); - } catch (\Doctrine\ORM\UnexpectedResultException $exc) { + } catch (UnexpectedResultException $exc) { $this->assertInstanceOf('\Doctrine\ORM\NoResultException', $exc); } @@ -766,7 +768,7 @@ public function testUnexpectedResultException() try { $this->_em->createQuery($dql)->getSingleResult(); $this->fail('Expected exception "\Doctrine\ORM\NonUniqueResultException".'); - } catch (\Doctrine\ORM\UnexpectedResultException $exc) { + } catch (UnexpectedResultException $exc) { $this->assertInstanceOf('\Doctrine\ORM\NonUniqueResultException', $exc); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php b/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php index 0cfbdc16ef3..dd8a23ff374 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php @@ -1,13 +1,14 @@ * @author Benjamin Eberlei */ -class ReferenceProxyTest extends \Doctrine\Tests\OrmFunctionalTestCase +class ReferenceProxyTest extends OrmFunctionalTestCase { protected function setUp() { @@ -230,9 +232,9 @@ public function testCommonPersistenceProxy() { $id = $this->createProduct(); - /* @var $entity Doctrine\Tests\Models\ECommerce\ECommerceProduct */ + /* @var $entity ECommerceProduct */ $entity = $this->_em->getReference('Doctrine\Tests\Models\ECommerce\ECommerceProduct' , $id); - $className = \Doctrine\Common\Util\ClassUtils::getClass($entity); + $className = ClassUtils::getClass($entity); $this->assertInstanceOf('Doctrine\Common\Persistence\Proxy', $entity); $this->assertFalse($entity->__isInitialized()); diff --git a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php index 5804734766c..e1bd93ed792 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php @@ -2,16 +2,19 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\ORM\Query; +use Doctrine\ORM\Query\ResultSetMapping; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\CMS\CmsArticle; use Doctrine\Common\Cache\ArrayCache; +use Doctrine\Tests\OrmFunctionalTestCase; /** * ResultCacheTest * * @author robo */ -class ResultCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase +class ResultCacheTest extends OrmFunctionalTestCase { /** * @var \ReflectionProperty @@ -133,7 +136,7 @@ public function testUseResultCacheParams() public function testNativeQueryResultCaching() { $cache = new ArrayCache(); - $rsm = new \Doctrine\ORM\Query\ResultSetMapping(); + $rsm = new ResultSetMapping(); $rsm->addScalarResult('id', 'u', 'integer'); @@ -190,7 +193,7 @@ public function testResultCacheNotDependsOnHydrationMode($query) $cache = $query->getResultCacheDriver(); $cacheCount = $this->getCacheSize($cache); - $this->assertNotEquals(\Doctrine\ORM\Query::HYDRATE_ARRAY, $query->getHydrationMode()); + $this->assertNotEquals(Query::HYDRATE_ARRAY, $query->getHydrationMode()); $query->getArrayResult(); $this->assertEquals($cacheCount, $this->getCacheSize($cache)); diff --git a/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php b/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php index bbf688c46b3..5fccc0bdb81 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php @@ -3,6 +3,7 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\DBAL\Types\Type as DBALType; +use Doctrine\ORM\Configuration; use Doctrine\ORM\Query\Filter\SQLFilter; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Common\Cache\ArrayCache; @@ -21,6 +22,7 @@ use Doctrine\Tests\Models\Company\CompanyFlexContract; use Doctrine\Tests\Models\Company\CompanyFlexUltraContract; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests SQLFilter functionality. @@ -29,7 +31,7 @@ * * @group non-cacheable */ -class SQLFilterTest extends \Doctrine\Tests\OrmFunctionalTestCase +class SQLFilterTest extends OrmFunctionalTestCase { private $userId, $userId2, $articleId, $articleId2; private $groupId, $groupId2; @@ -54,7 +56,7 @@ public function tearDown() public function testConfigureFilter() { - $config = new \Doctrine\ORM\Configuration(); + $config = new Configuration(); $config->addFilter("locale", "\Doctrine\Tests\ORM\Functional\MyLocaleFilter"); @@ -69,7 +71,7 @@ public function testEntityManagerEnableFilter() // Enable an existing filter $filter = $em->getFilters()->enable("locale"); - $this->assertTrue($filter instanceof \Doctrine\Tests\ORM\Functional\MyLocaleFilter); + $this->assertTrue($filter instanceof MyLocaleFilter); // Enable the filter again $filter2 = $em->getFilters()->enable("locale"); @@ -223,7 +225,7 @@ public function testSQLFilterGetSetParameter() ->with($this->equalTo('en')) ->will($this->returnValue("'en'")); - $em = $this->getMockEntityManager($conn); + $em = $this->getMockEntityManager(); $em->expects($this->once()) ->method('getConnection') ->will($this->returnValue($conn)); @@ -249,7 +251,7 @@ public function testSQLFilterGetConnection() // Setup mock connection $conn = $this->getMockConnection(); - $em = $this->getMockEntityManager($conn); + $em = $this->getMockEntityManager(); $em->expects($this->once()) ->method('getConnection') ->will($this->returnValue($conn)); @@ -271,7 +273,7 @@ public function testSQLFilterSetParameterInfersType() ->with($this->equalTo('en')) ->will($this->returnValue("'en'")); - $em = $this->getMockEntityManager($conn); + $em = $this->getMockEntityManager(); $em->expects($this->once()) ->method('getConnection') ->will($this->returnValue($conn)); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php index 5e9fcda37ae..32c75d25de6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php @@ -3,13 +3,14 @@ namespace Doctrine\Tests\ORM\Functional\SchemaTool; use Doctrine\DBAL\Schema\Schema; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Functional tests for the Class Table Inheritance mapping strategy. * * @author robo */ -class CompanySchemaTest extends \Doctrine\Tests\OrmFunctionalTestCase +class CompanySchemaTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php index 8887a0751c0..22debe96212 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php @@ -3,8 +3,9 @@ namespace Doctrine\Tests\ORM\Functional\SchemaTool; use Doctrine\ORM\Tools; +use Doctrine\Tests\OrmFunctionalTestCase; -class DBAL483Test extends \Doctrine\Tests\OrmFunctionalTestCase +class DBAL483Test extends OrmFunctionalTestCase { public function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php index 22d2b1f8eed..4b4d0328d50 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php @@ -2,12 +2,14 @@ namespace Doctrine\Tests\ORM\Functional\SchemaTool; +use Doctrine\DBAL\Schema\Comparator; use Doctrine\ORM\Tools; +use Doctrine\Tests\OrmFunctionalTestCase; /** * WARNING: This test should be run as last test! It can affect others very easily! */ -class DDC214Test extends \Doctrine\Tests\OrmFunctionalTestCase +class DDC214Test extends OrmFunctionalTestCase { private $classes = array(); private $schemaTool = null; @@ -78,7 +80,7 @@ public function assertCreatedSchemaNeedsNoUpdates($classes) $fromSchema = $sm->createSchema(); $toSchema = $this->schemaTool->getSchemaFromMetadata($classMetadata); - $comparator = new \Doctrine\DBAL\Schema\Comparator(); + $comparator = new Comparator(); $schemaDiff = $comparator->compare($fromSchema, $toSchema); $sql = $schemaDiff->toSql($this->_em->getConnection()->getDatabasePlatform()); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php index 66e9906883b..f98fe4bebd5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php @@ -3,8 +3,9 @@ namespace Doctrine\Tests\ORM\Functional\SchemaTool; use Doctrine\ORM\Tools\SchemaTool; +use Doctrine\Tests\OrmFunctionalTestCase; -class PostgreSqlSchemaToolTest extends \Doctrine\Tests\OrmFunctionalTestCase +class PostgreSqlSchemaToolTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php index c09f336c979..06eb67a2eb1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php @@ -3,13 +3,14 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\ORM\Tools\SchemaValidator; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Test the validity of all modelsets * * @group DDC-1601 */ -class SchemaValidatorTest extends \Doctrine\Tests\OrmFunctionalTestCase +class SchemaValidatorTest extends OrmFunctionalTestCase { static public function dataValidateModelSets() { diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php index 6b177562fa2..f4d8e6b768d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php @@ -2,9 +2,11 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\ORM\Cache\DefaultCacheFactory; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Mocks\ConcurrentRegionMock; use Doctrine\ORM\Cache\Region\DefaultRegion; +use Doctrine\Tests\Mocks\TimestampRegionMock; use Doctrine\Tests\Models\Cache\Country; use Doctrine\ORM\Cache\CollectionCacheKey; use Doctrine\ORM\Cache\EntityCacheKey; @@ -126,7 +128,7 @@ public function testBasicConcurrentCollectionReadLock() } } -class CacheFactorySecondLevelCacheConcurrentTest extends \Doctrine\ORM\Cache\DefaultCacheFactory +class CacheFactorySecondLevelCacheConcurrentTest extends DefaultCacheFactory { public function __construct(Cache $cache) { @@ -143,6 +145,6 @@ public function getRegion(array $cache) public function getTimestampRegion() { - return new \Doctrine\Tests\Mocks\TimestampRegionMock(); + return new TimestampRegionMock(); } } \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php index 995c1d07f41..f5e1df0a8aa 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php @@ -2,6 +2,7 @@ namespace Doctrine\Tests\ORM\Functional; +use Doctrine\ORM\AbstractQuery; use Doctrine\Tests\Models\Cache\Country; use Doctrine\ORM\Query\ResultSetMapping; use Doctrine\Tests\Models\Cache\State; @@ -716,7 +717,7 @@ public function testQueryCacheLifetime() $this->secondLevelCacheLogger->clearStats(); $this->_em->clear(); - $getHash = function(\Doctrine\ORM\AbstractQuery $query){ + $getHash = function(AbstractQuery $query){ $method = new \ReflectionMethod($query, 'getHash'); $method->setAccessible(true); diff --git a/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php b/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php index 38a6e4d2da0..02c891e7557 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php @@ -3,8 +3,9 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\DBAL\Schema\Sequence; +use Doctrine\Tests\OrmFunctionalTestCase; -class SequenceEmulatedIdentityStrategyTest extends \Doctrine\Tests\OrmFunctionalTestCase +class SequenceEmulatedIdentityStrategyTest extends OrmFunctionalTestCase { /** * {@inheritdoc} diff --git a/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php b/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php index 6cb00f6869d..2fcd6a1b907 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php @@ -1,13 +1,14 @@ salesPerson = new \Doctrine\Tests\Models\Company\CompanyEmployee(); + $this->salesPerson = new CompanyEmployee(); $this->salesPerson->setName('Poor Sales Guy'); $this->salesPerson->setDepartment('Sales'); $this->salesPerson->setSalary(100); - $engineer1 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); + $engineer1 = new CompanyEmployee(); $engineer1->setName('Roman B.'); $engineer1->setDepartment('IT'); $engineer1->setSalary(100); $this->engineers[] = $engineer1; - $engineer2 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); + $engineer2 = new CompanyEmployee(); $engineer2->setName('Jonathan W.'); $engineer2->setDepartment('IT'); $engineer2->setSalary(100); $this->engineers[] = $engineer2; - $engineer3 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); + $engineer3 = new CompanyEmployee(); $engineer3->setName('Benjamin E.'); $engineer3->setDepartment('IT'); $engineer3->setSalary(100); $this->engineers[] = $engineer3; - $engineer4 = new \Doctrine\Tests\Models\Company\CompanyEmployee(); + $engineer4 = new CompanyEmployee(); $engineer4->setName('Guilherme B.'); $engineer4->setDepartment('IT'); $engineer4->setSalary(100); @@ -61,14 +66,14 @@ public function loadFullFixture() { $this->persistRelatedEmployees(); - $this->fix = new \Doctrine\Tests\Models\Company\CompanyFixContract(); + $this->fix = new CompanyFixContract(); $this->fix->setFixPrice(1000); $this->fix->setSalesPerson($this->salesPerson); $this->fix->addEngineer($this->engineers[0]); $this->fix->addEngineer($this->engineers[1]); $this->fix->markCompleted(); - $this->flex = new \Doctrine\Tests\Models\Company\CompanyFlexContract(); + $this->flex = new CompanyFlexContract(); $this->flex->setSalesPerson($this->salesPerson); $this->flex->setHoursWorked(100); $this->flex->setPricePerHour(100); @@ -77,7 +82,7 @@ public function loadFullFixture() $this->flex->addEngineer($this->engineers[3]); $this->flex->markCompleted(); - $this->ultra = new \Doctrine\Tests\Models\Company\CompanyFlexUltraContract(); + $this->ultra = new CompanyFlexUltraContract(); $this->ultra->setSalesPerson($this->salesPerson); $this->ultra->setHoursWorked(150); $this->ultra->setPricePerHour(150); @@ -96,7 +101,7 @@ public function testPersistChildOfBaseClass() { $this->persistRelatedEmployees(); - $fixContract = new \Doctrine\Tests\Models\Company\CompanyFixContract(); + $fixContract = new CompanyFixContract(); $fixContract->setFixPrice(1000); $fixContract->setSalesPerson($this->salesPerson); @@ -115,7 +120,7 @@ public function testPersistDeepChildOfBaseClass() { $this->persistRelatedEmployees(); - $ultraContract = new \Doctrine\Tests\Models\Company\CompanyFlexUltraContract(); + $ultraContract = new CompanyFlexUltraContract(); $ultraContract->setSalesPerson($this->salesPerson); $ultraContract->setHoursWorked(100); $ultraContract->setPricePerHour(50); diff --git a/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php index 31f28db3bc4..a335b234e08 100644 --- a/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php @@ -8,12 +8,13 @@ Doctrine\Tests\Models\ECommerce\ECommerceProduct; use Doctrine\ORM\Mapping\AssociationMapping; +use Doctrine\Tests\OrmFunctionalTestCase; /** * Tests capabilities of the persister. * @author Giorgio Sironi */ -class StandardEntityPersisterTest extends \Doctrine\Tests\OrmFunctionalTestCase +class StandardEntityPersisterTest extends OrmFunctionalTestCase { protected function setUp() { @@ -56,7 +57,7 @@ public function testAddPersistRetrieve() $p = new ECommerceProduct; $p->addFeature($f1); - $p->addfeature($f2); + $p->addFeature($f2); $this->_em->persist($p); $this->_em->flush(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php index 98de7ee38aa..fccb0fd4cdf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1050Test.php @@ -24,7 +24,7 @@ public function testPerformance() for ($i = 2; $i < 10000; ++$i) { $user = new CmsUser(); $user->status = 'developer'; - $user->username = 'jwage'+$i; + $user->username = 'jwage'.$i; $user->name = 'Jonathan'; $this->_em->persist($user); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php index cd678d5f1de..9369ca4c949 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1080Test.php @@ -57,7 +57,7 @@ public function testHydration() $this->_em->flush(); $this->_em->clear(); - $foo = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC1080Foo', $foo1->getFooId()); + $foo = $this->_em->find('Doctrine\Tests\ORM\Functional\Ticket\DDC1080Foo', $foo1->getFooID()); $fooBars = $foo->getFooBars(); $this->assertEquals(3, count($fooBars), "Should return three foobars."); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php index 53d6bb6e259..fda16824621 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php @@ -105,7 +105,7 @@ public function testNotCloneAndPassAroundFlush() $user2->groups = $user1->groups; $user2->groups->add($group3); - $this->assertEQuals(1, count($user1->groups->getInsertDiff())); + $this->assertCount(1, $user1->groups->getInsertDiff()); $this->_em->persist($group3); $this->_em->flush(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php index c6c23b9915a..5e587c4dfa8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php @@ -2,12 +2,13 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\ORM\Event\LifecycleEventArgs; +use Doctrine\ORM\Events; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @group DDC-1707 */ -class DDC1707Test extends \Doctrine\Tests\OrmFunctionalTestCase +class DDC1707Test extends OrmFunctionalTestCase { public function setUp() { @@ -27,9 +28,8 @@ public function testPostLoadOnChild() { $class = $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC1707Child'); $entity = new DDC1707Child(); - $event = new LifecycleEventArgs($entity, $this->_em); - $class->invokeLifecycleCallbacks(\Doctrine\ORM\Events::postLoad, $entity, $event); + $class->invokeLifecycleCallbacks(Events::postLoad, $entity); $this->assertTrue($entity->postLoad); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php index aebc6422c93..b2e02c26be1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php @@ -23,9 +23,9 @@ public function setUp() $this->user->name = "Benjamin"; $this->user->status = "active"; - $this->phone = new CmsPhoneNumber(); + $this->phone = new CmsPhonenumber(); $this->phone->phonenumber = '0123456789'; - $this->user->addPhoneNumber($this->phone); + $this->user->addPhonenumber($this->phone); $this->_em->persist($this->user); $this->_em->persist($this->phone); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php index 92df8d22fd0..5ec8ad730ae 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php @@ -22,7 +22,7 @@ public function testSelectFieldOnRootEntity() $q = $this->_em->createQuery('SELECT e.name FROM Doctrine\Tests\Models\Company\CompanyEmployee e'); $this->assertEquals( strtolower('SELECT c0_.name AS name_0 FROM company_employees c1_ INNER JOIN company_persons c0_ ON c1_.id = c0_.id LEFT JOIN company_managers c2_ ON c1_.id = c2_.id'), - strtolower($q->getSql()) + strtolower($q->getSQL()) ); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php index cb265dada23..eb368cd891d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php @@ -24,10 +24,10 @@ public function testRecomputeSingleEntityChangeSet_PreservesFieldOrder() $this->_em->persist($entity); $this->_em->getUnitOfWork()->computeChangeSet($this->_em->getClassMetadata(get_class($entity)), $entity); - $data1 = $this->_em->getUnitOfWork()->getEntityChangeset($entity); + $data1 = $this->_em->getUnitOfWork()->getEntityChangeSet($entity); $entity->setType('type2'); $this->_em->getUnitOfWork()->recomputeSingleEntityChangeSet($this->_em->getClassMetadata(get_class($entity)), $entity); - $data2 = $this->_em->getUnitOfWork()->getEntityChangeset($entity); + $data2 = $this->_em->getUnitOfWork()->getEntityChangeSet($entity); $this->assertEquals(array_keys($data1), array_keys($data2)); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php index 174726d5af4..295542aab1c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php @@ -22,7 +22,7 @@ public function setUp() */ private function setCascadeMergeFor($class) { - $metadata = $this->_em->getMetadataFactory()->getMetaDataFor($class); + $metadata = $this->_em->getMetadataFactory()->getMetadataFor($class); foreach ($metadata->associationMappings as $key => $associationMapping) { $metadata->associationMappings[$key]["isCascadePersist"] = false; $metadata->associationMappings[$key]["isCascadeMerge"] = true; diff --git a/tests/Doctrine/Tests/ORM/Functional/TypeTest.php b/tests/Doctrine/Tests/ORM/Functional/TypeTest.php index 47064d5e2f8..c27e0dee638 100644 --- a/tests/Doctrine/Tests/ORM/Functional/TypeTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/TypeTest.php @@ -9,8 +9,9 @@ use Doctrine\ORM\Mapping\AssociationMapping; use Doctrine\DBAL\Types\Type as DBALType; +use Doctrine\Tests\OrmFunctionalTestCase; -class TypeTest extends \Doctrine\Tests\OrmFunctionalTestCase +class TypeTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php b/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php index aae0fbc715b..8e305d1f13c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php @@ -6,8 +6,9 @@ use Doctrine\Tests\Models\CustomType\CustomTypeParent; use Doctrine\Tests\Models\CustomType\CustomTypeUpperCase; use Doctrine\DBAL\Types\Type as DBALType; +use Doctrine\Tests\OrmFunctionalTestCase; -class TypeValueSqlTest extends \Doctrine\Tests\OrmFunctionalTestCase +class TypeValueSqlTest extends OrmFunctionalTestCase { protected function setUp() { diff --git a/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php b/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php index 5fa237ee4d9..d5d559a4ff1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php @@ -1,10 +1,11 @@ assertEquals('1 = 1 AND 2 = 2', (string) $this->_expr->andx((string) $this->_expr->eq(1, 1), (string) $this->_expr->eq(2, 2))); + $this->assertEquals('1 = 1 AND 2 = 2', (string) $this->_expr->andX((string) $this->_expr->eq(1, 1), (string) $this->_expr->eq(2, 2))); } public function testIntelligentParenthesisPreventionAndExpr() { $this->assertEquals( '1 = 1 AND 2 = 2', - (string) $this->_expr->andx($this->_expr->orx($this->_expr->andx($this->_expr->eq(1, 1))), (string) $this->_expr->eq(2, 2)) + (string) $this->_expr->andX($this->_expr->orX($this->_expr->andX($this->_expr->eq(1, 1))), (string) $this->_expr->eq(2, 2)) ); } public function testOrExpr() { - $this->assertEquals('1 = 1 OR 2 = 2', (string) $this->_expr->orx((string) $this->_expr->eq(1, 1), (string) $this->_expr->eq(2, 2))); + $this->assertEquals('1 = 1 OR 2 = 2', (string) $this->_expr->orX((string) $this->_expr->eq(1, 1), (string) $this->_expr->eq(2, 2))); } public function testAbsExpr() @@ -311,11 +311,11 @@ public function testNotInLiteralExpr() public function testAndxOrxExpr() { - $andExpr = $this->_expr->andx(); + $andExpr = $this->_expr->andX(); $andExpr->add($this->_expr->eq(1, 1)); $andExpr->add($this->_expr->lt(1, 5)); - $orExpr = $this->_expr->orx(); + $orExpr = $this->_expr->orX(); $orExpr->add($andExpr); $orExpr->add($this->_expr->eq(1, 1)); @@ -324,7 +324,7 @@ public function testAndxOrxExpr() public function testOrxExpr() { - $orExpr = $this->_expr->orx(); + $orExpr = $this->_expr->orX(); $orExpr->add($this->_expr->eq(1, 1)); $orExpr->add($this->_expr->lt(1, 5)); @@ -356,7 +356,7 @@ public function testOrderByAsc() */ public function testAddThrowsException() { - $orExpr = $this->_expr->orx(); + $orExpr = $this->_expr->orX(); $orExpr->add($this->_expr->quot(5, 2)); } @@ -433,15 +433,17 @@ public function testExpressionGetter() $this->assertEquals(array('foo', 'bar'), $select->getParts()); } - public function testAddEmpty() { - $andExpr = $this->_expr->andx(); - $andExpr->add($this->_expr->andx()); + public function testAddEmpty() + { + $andExpr = $this->_expr->andX(); + $andExpr->add($this->_expr->andX()); $this->assertEquals(0, $andExpr->count()); } - public function testAddNull() { - $andExpr = $this->_expr->andx(); + public function testAddNull() + { + $andExpr = $this->_expr->andX(); $andExpr->add(null); $this->assertEquals(0, $andExpr->count()); diff --git a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php index daec446bbee..145b591e7a7 100644 --- a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php +++ b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php @@ -50,7 +50,7 @@ public function parseDql($dql, $hints = array()) { $query = $this->_em->createQuery($dql); $query->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true); - $query->setDql($dql); + $query->setDQL($dql); foreach ($hints as $key => $value) { $query->setHint($key, $value); diff --git a/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/tests/Doctrine/Tests/ORM/Query/QueryTest.php index d59c93b0741..7a3687c5216 100644 --- a/tests/Doctrine/Tests/ORM/Query/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Query/QueryTest.php @@ -74,7 +74,7 @@ public function testClone() $cloned = clone $query; - $this->assertEquals($dql, $cloned->getDql()); + $this->assertEquals($dql, $cloned->getDQL()); $this->assertEquals(0, count($cloned->getParameters())); $this->assertFalse($cloned->getHint('foo')); } @@ -92,7 +92,7 @@ public function testFluentQueryInterface() ->setParameters(new ArrayCollection(array(new Parameter(2, 'baz')))) ->setResultCacheDriver(null) ->setResultCacheId('foo') - ->setDql('foo') + ->setDQL('foo') ->setFirstResult(10) ->setMaxResults(10); diff --git a/tests/Doctrine/Tests/ORM/QueryBuilderTest.php b/tests/Doctrine/Tests/ORM/QueryBuilderTest.php index 318eb2a2f96..655b86a6ad9 100644 --- a/tests/Doctrine/Tests/ORM/QueryBuilderTest.php +++ b/tests/Doctrine/Tests/ORM/QueryBuilderTest.php @@ -51,7 +51,7 @@ protected function setUp() protected function assertValidQueryBuilder(QueryBuilder $qb, $expectedDql) { - $dql = $qb->getDql(); + $dql = $qb->getDQL(); $q = $qb->getQuery(); $this->assertEquals($expectedDql, $dql); @@ -632,7 +632,7 @@ public function testSetParameters() $qb = $this->_em->createQueryBuilder(); $qb->select('u') ->from('Doctrine\Tests\Models\CMS\CmsUser', 'u') - ->where($qb->expr()->orx('u.username = :username', 'u.username = :username2')); + ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2')); $parameters = new ArrayCollection(); $parameters->add(new Parameter('username', 'jwage')); @@ -788,7 +788,7 @@ public function testMultipleIsolatedQueryConstruction() $q1 = $qb->getQuery(); - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = :name', $q1->getDql()); + $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = :name', $q1->getDQL()); $this->assertEquals(1, count($q1->getParameters())); // add another condition and construct a second query @@ -797,7 +797,7 @@ public function testMultipleIsolatedQueryConstruction() $q2 = $qb->getQuery(); - $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = :name AND u.id = :id', $q2->getDql()); + $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name = :name AND u.id = :id', $q2->getDQL()); $this->assertTrue($q1 !== $q2); // two different, independent queries $this->assertEquals(2, count($q2->getParameters())); $this->assertEquals(1, count($q1->getParameters())); // $q1 unaffected @@ -843,7 +843,7 @@ public function testResetDQLPart() $this->assertEquals('u.username = ?1', (string)$qb->getDQLPart('where')); $this->assertEquals(1, count($qb->getDQLPart('orderBy'))); - $qb->resetDqlPart('where')->resetDqlPart('orderBy'); + $qb->resetDQLPart('where')->resetDQLPart('orderBy'); $this->assertNull($qb->getDQLPart('where')); $this->assertEquals(0, count($qb->getDQLPart('orderBy'))); diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php index 4dde0486271..08ade299929 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php @@ -62,7 +62,7 @@ public function tearDown() if ($file->isFile()) { \unlink($file->getPathname()); } elseif ($file->getBasename() === '.') { - $dirs[] = $file->getRealpath(); + $dirs[] = $file->getRealPath(); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php index 8a4b6ad5fc6..bcb16a3d6e2 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php @@ -55,7 +55,7 @@ public function tearDown() if ($file->isFile()) { \unlink($file->getPathname()); } elseif ($file->getBasename() === '.') { - $dirs[] = $file->getRealpath(); + $dirs[] = $file->getRealPath(); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php index f6c63f7528c..691b8ef2014 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php @@ -26,7 +26,7 @@ public function testCountQuery_MixedResultsWithName() $query->setFirstResult(null)->setMaxResults(null); $this->assertEquals( - "SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, sum(a0_.name) AS sclr_2 FROM Author a0_) dctrn_result) dctrn_table", $query->getSql() + "SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, sum(a0_.name) AS sclr_2 FROM Author a0_) dctrn_result) dctrn_table", $query->getSQL() ); } @@ -38,7 +38,7 @@ public function testCountQuery_Having() $query->setFirstResult(null)->setMaxResults(null); $this->assertEquals( - "SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_1 FROM (SELECT count(u0_.id) AS sclr_0, g1_.id AS id_1, u0_.id AS id_2 FROM groups g1_ LEFT JOIN user_group u2_ ON g1_.id = u2_.group_id LEFT JOIN User u0_ ON u0_.id = u2_.user_id GROUP BY g1_.id HAVING sclr_0 > 0) dctrn_result) dctrn_table", $query->getSql() + "SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_1 FROM (SELECT count(u0_.id) AS sclr_0, g1_.id AS id_1, u0_.id AS id_2 FROM groups g1_ LEFT JOIN user_group u2_ ON g1_.id = u2_.group_id LEFT JOIN User u0_ ON u0_.id = u2_.user_id GROUP BY g1_.id HAVING sclr_0 > 0) dctrn_result) dctrn_table", $query->getSQL() ); } @@ -55,7 +55,7 @@ public function testCountQueryOrderBySqlServer() $this->assertEquals( "SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_0 FROM (SELECT b0_.id AS id_0, b0_.author_id AS author_id_1, b0_.category_id AS category_id_2 FROM BlogPost b0_) dctrn_result) dctrn_table", - $query->getSql() + $query->getSQL() ); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php index b8d1b41a63f..888861582ad 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/CountWalkerTest.php @@ -32,7 +32,7 @@ public function testCountQuery_MixedResultsWithName() $query->setFirstResult(null)->setMaxResults(null); $this->assertEquals( - "SELECT count(DISTINCT a0_.id) AS sclr_0 FROM Author a0_", $query->getSql() + "SELECT count(DISTINCT a0_.id) AS sclr_0 FROM Author a0_", $query->getSQL() ); } @@ -45,7 +45,7 @@ public function testCountQuery_KeepsGroupBy() $query->setFirstResult(null)->setMaxResults(null); $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ GROUP BY b0_.id", $query->getSql() + "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ GROUP BY b0_.id", $query->getSQL() ); } @@ -58,7 +58,7 @@ public function testCountQuery_RemovesOrderBy() $query->setFirstResult(null)->setMaxResults(null); $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $query->getSql() + "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $query->getSQL() ); } @@ -71,7 +71,7 @@ public function testCountQuery_RemovesLimits() $query->setFirstResult(null)->setMaxResults(null); $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $query->getSql() + "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ INNER JOIN Category c1_ ON b0_.category_id = c1_.id INNER JOIN Author a2_ ON b0_.author_id = a2_.id", $query->getSQL() ); } @@ -88,7 +88,7 @@ public function testCountQuery_HavingException() 'Cannot count query that uses a HAVING clause. Use the output walkers for pagination' ); - $query->getSql(); + $query->getSQL(); } /** @@ -103,7 +103,7 @@ public function testCountQueryWithArbitraryJoin() $query->setFirstResult(null)->setMaxResults(null); $this->assertEquals( - "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ LEFT JOIN Category c1_ ON (b0_.category_id = c1_.id)", $query->getSql() + "SELECT count(DISTINCT b0_.id) AS sclr_0 FROM BlogPost b0_ LEFT JOIN Category c1_ ON (b0_.category_id = c1_.id)", $query->getSQL() ); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php index b30ef51fc9c..78fd38e9a39 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php @@ -33,7 +33,7 @@ public function testLimitSubqueryWithSortPg() $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker'); $this->assertEquals( - "SELECT DISTINCT id_0, MIN(sclr_5) AS dctrn_minrownum FROM (SELECT m0_.id AS id_0, m0_.title AS title_1, c1_.id AS id_2, a2_.id AS id_3, a2_.name AS name_4, ROW_NUMBER() OVER(ORDER BY m0_.title ASC) AS sclr_5, m0_.author_id AS author_id_6, m0_.category_id AS category_id_7 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id) dctrn_result GROUP BY id_0 ORDER BY dctrn_minrownum ASC", $limitQuery->getSql() + "SELECT DISTINCT id_0, MIN(sclr_5) AS dctrn_minrownum FROM (SELECT m0_.id AS id_0, m0_.title AS title_1, c1_.id AS id_2, a2_.id AS id_3, a2_.name AS name_4, ROW_NUMBER() OVER(ORDER BY m0_.title ASC) AS sclr_5, m0_.author_id AS author_id_6, m0_.category_id AS category_id_7 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id) dctrn_result GROUP BY id_0 ORDER BY dctrn_minrownum ASC", $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -52,7 +52,7 @@ public function testLimitSubqueryWithScalarSortPg() $this->assertEquals( "SELECT DISTINCT id_1, MIN(sclr_3) AS dctrn_minrownum FROM (SELECT COUNT(g0_.id) AS sclr_0, u1_.id AS id_1, g0_.id AS id_2, ROW_NUMBER() OVER(ORDER BY COUNT(g0_.id) ASC) AS sclr_3 FROM User u1_ INNER JOIN user_group u2_ ON u1_.id = u2_.user_id INNER JOIN groups g0_ ON g0_.id = u2_.group_id) dctrn_result GROUP BY id_1 ORDER BY dctrn_minrownum ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -71,7 +71,7 @@ public function testLimitSubqueryWithMixedSortPg() $this->assertEquals( "SELECT DISTINCT id_1, MIN(sclr_3) AS dctrn_minrownum FROM (SELECT COUNT(g0_.id) AS sclr_0, u1_.id AS id_1, g0_.id AS id_2, ROW_NUMBER() OVER(ORDER BY COUNT(g0_.id) ASC, u1_.id DESC) AS sclr_3 FROM User u1_ INNER JOIN user_group u2_ ON u1_.id = u2_.user_id INNER JOIN groups g0_ ON g0_.id = u2_.group_id) dctrn_result GROUP BY id_1 ORDER BY dctrn_minrownum ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -90,7 +90,7 @@ public function testLimitSubqueryWithHiddenScalarSortPg() $this->assertEquals( "SELECT DISTINCT id_1, MIN(sclr_3) AS dctrn_minrownum FROM (SELECT COUNT(g0_.id) AS sclr_0, u1_.id AS id_1, g0_.id AS id_2, ROW_NUMBER() OVER(ORDER BY COUNT(g0_.id) ASC, u1_.id DESC) AS sclr_3 FROM User u1_ INNER JOIN user_group u2_ ON u1_.id = u2_.user_id INNER JOIN groups g0_ ON g0_.id = u2_.group_id) dctrn_result GROUP BY id_1 ORDER BY dctrn_minrownum ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -118,7 +118,7 @@ public function testLimitSubqueryWithSortOracle() $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker'); $this->assertEquals( - "SELECT DISTINCT ID_0, MIN(SCLR_5) AS dctrn_minrownum FROM (SELECT m0_.id AS ID_0, m0_.title AS TITLE_1, c1_.id AS ID_2, a2_.id AS ID_3, a2_.name AS NAME_4, ROW_NUMBER() OVER(ORDER BY m0_.title ASC) AS SCLR_5, m0_.author_id AS AUTHOR_ID_6, m0_.category_id AS CATEGORY_ID_7 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id) dctrn_result GROUP BY ID_0 ORDER BY dctrn_minrownum ASC", $limitQuery->getSql() + "SELECT DISTINCT ID_0, MIN(SCLR_5) AS dctrn_minrownum FROM (SELECT m0_.id AS ID_0, m0_.title AS TITLE_1, c1_.id AS ID_2, a2_.id AS ID_3, a2_.name AS NAME_4, ROW_NUMBER() OVER(ORDER BY m0_.title ASC) AS SCLR_5, m0_.author_id AS AUTHOR_ID_6, m0_.category_id AS CATEGORY_ID_7 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id) dctrn_result GROUP BY ID_0 ORDER BY dctrn_minrownum ASC", $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -138,7 +138,7 @@ public function testLimitSubqueryWithScalarSortOracle() $this->assertEquals( "SELECT DISTINCT ID_1, MIN(SCLR_3) AS dctrn_minrownum FROM (SELECT COUNT(g0_.id) AS SCLR_0, u1_.id AS ID_1, g0_.id AS ID_2, ROW_NUMBER() OVER(ORDER BY COUNT(g0_.id) ASC) AS SCLR_3 FROM User u1_ INNER JOIN user_group u2_ ON u1_.id = u2_.user_id INNER JOIN groups g0_ ON g0_.id = u2_.group_id) dctrn_result GROUP BY ID_1 ORDER BY dctrn_minrownum ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -158,7 +158,7 @@ public function testLimitSubqueryWithMixedSortOracle() $this->assertEquals( "SELECT DISTINCT ID_1, MIN(SCLR_3) AS dctrn_minrownum FROM (SELECT COUNT(g0_.id) AS SCLR_0, u1_.id AS ID_1, g0_.id AS ID_2, ROW_NUMBER() OVER(ORDER BY COUNT(g0_.id) ASC, u1_.id DESC) AS SCLR_3 FROM User u1_ INNER JOIN user_group u2_ ON u1_.id = u2_.user_id INNER JOIN groups g0_ ON g0_.id = u2_.group_id) dctrn_result GROUP BY ID_1 ORDER BY dctrn_minrownum ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -176,7 +176,7 @@ public function testLimitSubqueryOracle() $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker'); $this->assertEquals( - "SELECT DISTINCT ID_0 FROM (SELECT m0_.id AS ID_0, m0_.title AS TITLE_1, c1_.id AS ID_2, a2_.id AS ID_3, a2_.name AS NAME_4, m0_.author_id AS AUTHOR_ID_5, m0_.category_id AS CATEGORY_ID_6 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id) dctrn_result", $limitQuery->getSql() + "SELECT DISTINCT ID_0 FROM (SELECT m0_.id AS ID_0, m0_.title AS TITLE_1, c1_.id AS ID_2, a2_.id AS ID_3, a2_.name AS NAME_4, m0_.author_id AS AUTHOR_ID_5, m0_.category_id AS CATEGORY_ID_6 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id) dctrn_result", $limitQuery->getSQL() ); $this->entityManager->getConnection()->setDatabasePlatform($odp); @@ -190,7 +190,7 @@ public function testCountQueryMixedResultsWithName() $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker'); $this->assertEquals( - "SELECT DISTINCT id_0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, sum(a0_.name) AS sclr_2 FROM Author a0_) dctrn_result", $limitQuery->getSql() + "SELECT DISTINCT id_0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, sum(a0_.name) AS sclr_2 FROM Author a0_) dctrn_result", $limitQuery->getSQL() ); } @@ -285,7 +285,7 @@ public function testLimitSubqueryWithHiddenSelectionInOrderBy() $this->assertEquals( 'SELECT DISTINCT id_0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, a0_.name AS name_2 FROM Author a0_) dctrn_result ORDER BY name_2 DESC', - $query->getSql() + $query->getSQL() ); } @@ -374,7 +374,7 @@ public function testLimitSubqueryOrderByFieldFromMappedSuperclass() */ public function testLimitSubqueryOrderBySubSelectOrderByExpression() { - $this->entityManager->getConnection()->setDatabasePlatform(new MysqlPlatform()); + $this->entityManager->getConnection()->setDatabasePlatform(new MySqlPlatform()); $query = $this->entityManager->createQuery( 'SELECT a, diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php index fb11feb7aaf..30da257891c 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryWalkerTest.php @@ -33,7 +33,7 @@ public function testLimitSubqueryWithSort() $this->assertEquals( "SELECT DISTINCT m0_.id AS id_0, m0_.title AS title_1 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON m0_.category_id = c1_.id INNER JOIN Author a2_ ON m0_.author_id = a2_.id ORDER BY m0_.title ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); } @@ -47,7 +47,7 @@ public function testCountQuery_MixedResultsWithName() $this->assertEquals( "SELECT DISTINCT a0_.id AS id_0, sum(a0_.name) AS sclr_1 FROM Author a0_", - $limitQuery->getSql() + $limitQuery->getSQL() ); } @@ -64,7 +64,7 @@ public function testLimitSubqueryWithSortOnAssociation() $this->assertEquals( "SELECT DISTINCT m0_.id AS id_0, m0_.author_id AS sclr_1 FROM MyBlogPost m0_ ORDER BY m0_.author_id ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); } @@ -81,7 +81,7 @@ public function testLimitSubqueryWithArbitraryJoin() $this->assertEquals( "SELECT DISTINCT m0_.id AS id_0 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON (m0_.category_id = c1_.id)", - $limitQuery->getSql() + $limitQuery->getSQL() ); } @@ -95,7 +95,7 @@ public function testLimitSubqueryWithSortWithArbitraryJoin() $this->assertEquals( "SELECT DISTINCT m0_.id AS id_0, m0_.title AS title_1 FROM MyBlogPost m0_ INNER JOIN Category c1_ ON (m0_.category_id = c1_.id) ORDER BY m0_.title ASC", - $limitQuery->getSql() + $limitQuery->getSQL() ); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php index 5f9a3430fe8..f89ea5704d1 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/WhereInWalkerTest.php @@ -34,7 +34,7 @@ public function testCountQuery_MixedResultsWithName() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT a0_.id AS id_0, a0_.name AS name_1, sum(a0_.name) AS sclr_2 FROM Author a0_ WHERE a0_.id IN (?)", $whereInQuery->getSql() + "SELECT a0_.id AS id_0, a0_.name AS name_1, sum(a0_.name) AS sclr_2 FROM Author a0_ WHERE a0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -48,7 +48,7 @@ public function testWhereInQuery_SingleWhere() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE 1 = 1 AND u0_.id IN (?)", $whereInQuery->getSql() + "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE 1 = 1 AND u0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -62,7 +62,7 @@ public function testWhereInQuery_MultipleWhereWithAnd() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE 1 = 1 AND 2 = 2 AND u0_.id IN (?)", $whereInQuery->getSql() + "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE 1 = 1 AND 2 = 2 AND u0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -76,7 +76,7 @@ public function testWhereInQuery_MultipleWhereWithOr() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 OR 2 = 2) AND u0_.id IN (?)", $whereInQuery->getSql() + "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 OR 2 = 2) AND u0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -90,7 +90,7 @@ public function testWhereInQuery_MultipleWhereWithMixed_1() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 OR 2 = 2) AND 3 = 3 AND u0_.id IN (?)", $whereInQuery->getSql() + "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 OR 2 = 2) AND 3 = 3 AND u0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -104,7 +104,7 @@ public function testWhereInQuery_MultipleWhereWithMixed_2() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 AND 2 = 2 OR 3 = 3) AND u0_.id IN (?)", $whereInQuery->getSql() + "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (1 = 1 AND 2 = 2 OR 3 = 3) AND u0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -118,7 +118,7 @@ public function testWhereInQuery_WhereNot() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (NOT 1 = 2) AND u0_.id IN (?)", $whereInQuery->getSql() + "SELECT u0_.id AS id_0, g1_.id AS id_1 FROM User u0_ INNER JOIN user_group u2_ ON u0_.id = u2_.user_id INNER JOIN groups g1_ ON g1_.id = u2_.group_id WHERE (NOT 1 = 2) AND u0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -134,7 +134,7 @@ public function testWhereInQueryWithArbitraryJoin_NoWhere() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT b0_.id AS id_0, b0_.author_id AS author_id_1, b0_.category_id AS category_id_2 FROM BlogPost b0_ INNER JOIN Category c1_ ON (b0_.category_id = c1_.id) WHERE b0_.id IN (?)", $whereInQuery->getSql() + "SELECT b0_.id AS id_0, b0_.author_id AS author_id_1, b0_.category_id AS category_id_2 FROM BlogPost b0_ INNER JOIN Category c1_ ON (b0_.category_id = c1_.id) WHERE b0_.id IN (?)", $whereInQuery->getSQL() ); } @@ -147,7 +147,7 @@ public function testWhereInQueryWithArbitraryJoin_SingleWhere() $whereInQuery->setHint(WhereInWalker::HINT_PAGINATOR_ID_COUNT, 10); $this->assertEquals( - "SELECT b0_.id AS id_0, b0_.author_id AS author_id_1, b0_.category_id AS category_id_2 FROM BlogPost b0_ INNER JOIN Category c1_ ON (b0_.category_id = c1_.id) WHERE 1 = 1 AND b0_.id IN (?)", $whereInQuery->getSql() + "SELECT b0_.id AS id_0, b0_.author_id AS author_id_1, b0_.category_id AS category_id_2 FROM BlogPost b0_ INNER JOIN Category c1_ ON (b0_.category_id = c1_.id) WHERE 1 = 1 AND b0_.id IN (?)", $whereInQuery->getSQL() ); } }