diff --git a/UPGRADE.md b/UPGRADE.md index 56a8f8f7a6b..ac0303675ba 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,19 @@ # Upgrade to 3.0 +## BC Break: Removed support for entity namespace aliases + +The support for namespace aliases has been removed. +Please migrate to using `::class` for referencing classes. + +These methods have been removed: + + * `Doctrine\ORM\Configuration::addEntityNamespace()` + * `Doctrine\ORM\Configuration::getEntityNamespace()` + * `Doctrine\ORM\Configuration::setEntityNamespaces()` + * `Doctrine\ORM\Configuration::getEntityNamespaces()` + * `Doctrine\ORM\Mapping\AbstractClassMetadataFactory::getFqcnFromAlias()` + * `Doctrine\ORM\ORMException::unknownEntityNamespace()` + ## BC Break: Removed same-namespace class name resolution Support for same-namespace class name resolution in mappings has been removed. diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index fdd1924e943..c7149647991 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -1462,7 +1462,6 @@ Terminals - identifier (name, email, ...) must match ``[a-z_][a-z0-9_]*`` - fully_qualified_name (Doctrine\Tests\Models\CMS\CmsUser) matches PHP's fully qualified class names -- aliased_name (CMS:CmsUser) uses two identifiers, one for the namespace alias and one for the class inside it - string ('foo', 'bar''s house', '%ninja%', ...) - char ('/', '\\', ' ', ...) - integer (-1, 0, 1, 34, ...) @@ -1497,7 +1496,7 @@ Identifiers AliasIdentificationVariable :: = identifier /* identifier that must be a class name (the "User" of "FROM User u"), possibly as a fully qualified class name or namespace-aliased */ - AbstractSchemaName ::= fully_qualified_name | aliased_name | identifier + AbstractSchemaName ::= fully_qualified_name | identifier /* Alias ResultVariable declaration (the "total" of "COUNT(*) AS total") */ AliasResultVariable = identifier diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 7fd9b099f7c..5800df88321 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -405,7 +405,6 @@ public function processParameterValue($value) */ public function setResultSetMapping(Query\ResultSetMapping $rsm) { - $this->translateNamespaces($rsm); $this->resultSetMapping = $rsm; return $this; @@ -421,19 +420,6 @@ protected function getResultSetMapping() return $this->resultSetMapping; } - /** - * Allows to translate entity namespaces to full qualified names. - */ - private function translateNamespaces(Query\ResultSetMapping $rsm) - { - $translate = function ($alias) { - return $this->em->getClassMetadata($alias)->getClassName(); - }; - - $rsm->aliasMap = array_map($translate, $rsm->aliasMap); - $rsm->declaringClasses = array_map($translate, $rsm->declaringClasses); - } - /** * Set a cache profile for hydration caching. * diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index d98da5e323d..f8ba229db92 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -62,11 +62,6 @@ class Configuration extends DBALConfiguration */ private $metadataCache; - /** - * @var string[] indexed by alias - */ - private $entityNamespaces = []; - /** * @var string[] of DQL, indexed by query name */ @@ -211,48 +206,6 @@ public function newDefaultAnnotationDriver(array $paths = []) : AnnotationDriver return new AnnotationDriver($reader, $paths); } - /** - * Adds a namespace under a certain alias. - */ - public function addEntityNamespace(string $alias, string $namespace) : void - { - $this->entityNamespaces[$alias] = $namespace; - } - - /** - * Resolves a registered namespace alias to the full namespace. - * - * @throws ORMException - */ - public function getEntityNamespace(string $entityNamespaceAlias) : string - { - if (! isset($this->entityNamespaces[$entityNamespaceAlias])) { - throw ORMException::unknownEntityNamespace($entityNamespaceAlias); - } - - return trim($this->entityNamespaces[$entityNamespaceAlias], '\\'); - } - - /** - * Sets the entity alias map. - * - * @param string[] $entityNamespaces indexed by namespace alias - */ - public function setEntityNamespaces(array $entityNamespaces) : void - { - $this->entityNamespaces = $entityNamespaces; - } - - /** - * Retrieves the list of registered entity namespace aliases. - * - * @return string[] indexed by namespace alias - */ - public function getEntityNamespaces() : array - { - return $this->entityNamespaces; - } - /** * Gets the cache driver implementation that is used for the mapping metadata. */ diff --git a/lib/Doctrine/ORM/Mapping/AbstractClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/AbstractClassMetadataFactory.php index 66537fc0ed0..94b0ef8fab9 100644 --- a/lib/Doctrine/ORM/Mapping/AbstractClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/AbstractClassMetadataFactory.php @@ -307,12 +307,6 @@ protected function onNotFoundMetadata( private function normalizeClassName(string $className) : string { - if (strpos($className, ':') !== false) { - [$namespaceAlias, $simpleClassName] = explode(':', $className, 2); - - return $this->getFqcnFromAlias($namespaceAlias, $simpleClassName); - } - return StaticClassNameConverter::getRealClass($className); } @@ -322,14 +316,6 @@ private function normalizeClassName(string $className) : string */ abstract protected function initialize() : void; - /** - * Gets the fully qualified class-name from the namespace alias. - * - * @param string $namespaceAlias - * @param string $simpleClassName - */ - abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) : string; - /** * Returns the mapping driver implementation. */ diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 3d010316a7a..b9d82d3b29a 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -518,14 +518,6 @@ private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) } } - /** - * {@inheritDoc} - */ - protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) : string - { - return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; - } - /** * {@inheritDoc} */ diff --git a/lib/Doctrine/ORM/ORMException.php b/lib/Doctrine/ORM/ORMException.php index bdc5c88d899..ff5609e5283 100644 --- a/lib/Doctrine/ORM/ORMException.php +++ b/lib/Doctrine/ORM/ORMException.php @@ -252,16 +252,6 @@ public static function proxyClassesAlwaysRegenerating() return new self('Proxy Classes are always regenerating.'); } - /** - * @param string $entityNamespaceAlias - * - * @return ORMException - */ - public static function unknownEntityNamespace($entityNamespaceAlias) - { - return new self(sprintf("Unknown Entity namespace alias '%s'.", $entityNamespaceAlias)); - } - /** * @param string $className * diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 9de727cebca..3fecc8111b1 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -914,7 +914,7 @@ public function AliasIdentificationVariable() } /** - * AbstractSchemaName ::= fully_qualified_name | aliased_name | identifier + * AbstractSchemaName ::= fully_qualified_name | identifier * * @return string */ @@ -923,20 +923,12 @@ public function AbstractSchemaName() if ($this->lexer->isNextToken(Lexer::T_FULLY_QUALIFIED_NAME)) { $this->match(Lexer::T_FULLY_QUALIFIED_NAME); - $schemaName = $this->lexer->token['value']; - } elseif ($this->lexer->isNextToken(Lexer::T_IDENTIFIER)) { - $this->match(Lexer::T_IDENTIFIER); - - $schemaName = $this->lexer->token['value']; - } else { - $this->match(Lexer::T_ALIASED_NAME); - - list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']); - - $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName; + return $this->lexer->token['value']; } - return $schemaName; + $this->match(Lexer::T_IDENTIFIER); + + return $this->lexer->token['value']; } /** diff --git a/tests/Doctrine/Tests/ORM/ConfigurationTest.php b/tests/Doctrine/Tests/ORM/ConfigurationTest.php index 4123627faac..a1316022d0c 100644 --- a/tests/Doctrine/Tests/ORM/ConfigurationTest.php +++ b/tests/Doctrine/Tests/ORM/ConfigurationTest.php @@ -66,17 +66,6 @@ public function testNewDefaultAnnotationDriver() self::assertInstanceOf(AnnotationNamespace\PrePersist::class, $annotation); } - public function testSetGetEntityNamespace() - { - $this->configuration->addEntityNamespace('TestNamespace', __NAMESPACE__); - self::assertSame(__NAMESPACE__, $this->configuration->getEntityNamespace('TestNamespace')); - $namespaces = ['OtherNamespace' => __NAMESPACE__]; - $this->configuration->setEntityNamespaces($namespaces); - self::assertSame($namespaces, $this->configuration->getEntityNamespaces()); - $this->expectException(ORMException::class); - $this->configuration->getEntityNamespace('NonExistingNamespace'); - } - public function testSetGetQueryCacheImpl() { self::assertNull($this->configuration->getQueryCacheImpl()); // defaults diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php index 790adcfac8b..92e38e38eac 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php @@ -23,14 +23,6 @@ protected function setUp() parent::setUp(); } - public function tearDown() - { - if ($this->em) { - $this->em->getConfiguration()->setEntityNamespaces([]); - } - parent::tearDown(); - } - public function loadFixture() { $today = new DateTimeModel(); diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index b8e45a5f872..3703c0df9bd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -34,14 +34,6 @@ protected function setUp() parent::setUp(); } - public function tearDown() - { - if ($this->em) { - $this->em->getConfiguration()->setEntityNamespaces([]); - } - parent::tearDown(); - } - public function loadFixture() { $user = new CmsUser; @@ -261,19 +253,6 @@ public function testFindAll() self::assertCount(4, $users); } - public function testFindByAlias() - { - $user1Id = $this->loadFixture(); - $repos = $this->em->getRepository(CmsUser::class); - - $this->em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); - - $repos = $this->em->getRepository('CMS:CmsUser'); - - $users = $repos->findAll(); - self::assertCount(4, $users); - } - public function testCount() { $this->loadFixture(); @@ -647,22 +626,6 @@ public function testSetDefaultRepositoryInvalidClassError() $this->em->getConfiguration()->setDefaultRepositoryClassName(DDC753InvalidRepository::class); } - /** - * @group DDC-3257 - */ - public function testSingleRepositoryInstanceForDifferentEntityAliases() - { - $config = $this->em->getConfiguration(); - - $config->addEntityNamespace('Aliased', 'Doctrine\Tests\Models\CMS'); - $config->addEntityNamespace('AliasedAgain', 'Doctrine\Tests\Models\CMS'); - - $repository = $this->em->getRepository(CmsUser::class); - - self::assertSame($repository, $this->em->getRepository('Aliased:CmsUser')); - self::assertSame($repository, $this->em->getRepository('AliasedAgain:CmsUser')); - } - /** * @group DDC-3257 */ diff --git a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php index dd846732730..eb14c692e19 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php @@ -210,62 +210,6 @@ public function testShouldAssumeFromEntityNamespaceWhenNotGiven() self::assertInstanceOf(CmsUserDTO::class, $result[2]); } - public function testShouldSupportFromEntityNamespaceAlias() - { - $dql = " - SELECT - new CmsUserDTO(u.name, e.email, a.city) - FROM - cms:CmsUser u - JOIN - u.email e - JOIN - u.address a - ORDER BY - u.name"; - - - $this->em->getConfiguration() - ->addEntityNamespace('cms', 'Doctrine\Tests\Models\CMS'); - - $query = $this->em->createQuery($dql); - $result = $query->getResult(); - - self::assertCount(3, $result); - - self::assertInstanceOf(CmsUserDTO::class, $result[0]); - self::assertInstanceOf(CmsUserDTO::class, $result[1]); - self::assertInstanceOf(CmsUserDTO::class, $result[2]); - } - - public function testShouldSupportValueObjectNamespaceAlias() - { - $dql = " - SELECT - new cms:CmsUserDTO(u.name, e.email, a.city) - FROM - cms:CmsUser u - JOIN - u.email e - JOIN - u.address a - ORDER BY - u.name"; - - - $this->em->getConfiguration() - ->addEntityNamespace('cms', 'Doctrine\Tests\Models\CMS'); - - $query = $this->em->createQuery($dql); - $result = $query->getResult(); - - self::assertCount(3, $result); - - self::assertInstanceOf(CmsUserDTO::class, $result[0]); - self::assertInstanceOf(CmsUserDTO::class, $result[1]); - self::assertInstanceOf(CmsUserDTO::class, $result[2]); - } - public function testShouldSupportLiteralExpression() { $dql = " diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php index d6144d6bae0..0991099b245 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php @@ -26,14 +26,6 @@ protected function setUp() parent::setUp(); } - public function tearDown() - { - if ($this->em) { - $this->em->getConfiguration()->setEntityNamespaces([]); - } - parent::tearDown(); - } - public function loadTweetFixture() { $author = new TweetUser(); diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php index 63e0c39b853..ae6de67fdc1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php @@ -412,23 +412,6 @@ public function testModifiedLimitQuery() ->getScalarResult(); } - public function testSupportsQueriesWithEntityNamespaces() - { - $this->em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); - - try { - $query = $this->em->createQuery('UPDATE CMS:CmsUser u SET u.name = ?1'); - - self::assertEquals('UPDATE "cms_users" SET "name" = ?', $query->getSQL()); - - $query->free(); - } catch (\Exception $e) { - $this->fail($e->getMessage()); - } - - $this->em->getConfiguration()->setEntityNamespaces([]); - } - /** * @group DDC-604 */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php deleted file mode 100644 index 4860a2f4d9a..00000000000 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php +++ /dev/null @@ -1,120 +0,0 @@ -schemaTool->createSchema( - [ - $this->em->getClassMetadata(DDC2256User::class), - $this->em->getClassMetadata(DDC2256Group::class) - ] - ); - } - - public function testIssue() - { - $config = $this->em->getConfiguration(); - $config->addEntityNamespace('MyNamespace', __NAMESPACE__); - - $user = new DDC2256User(); - $user->name = 'user'; - $group = new DDC2256Group(); - $group->name = 'group'; - $user->group = $group; - - $this->em->persist($user); - $this->em->persist($group); - $this->em->flush(); - $this->em->clear(); - - $sql = 'SELECT u.id, u.name, g.id as group_id, g.name as group_name FROM ddc2256_users u LEFT JOIN ddc2256_groups g ON u.group_id = g.id'; - - // Test ResultSetMapping. - $rsm = new ResultSetMapping(); - - $rsm->addEntityResult('MyNamespace:DDC2256User', 'u'); - $rsm->addFieldResult('u', 'id', 'id'); - $rsm->addFieldResult('u', 'name', 'name'); - - $rsm->addJoinedEntityResult('MyNamespace:DDC2256Group', 'g', 'u', 'group'); - $rsm->addFieldResult('g', 'group_id', 'id'); - $rsm->addFieldResult('g', 'group_name', 'name'); - - self::assertCount(1, $this->em->createNativeQuery($sql, $rsm)->getResult()); - - // Test ResultSetMappingBuilder. - $rsm = new ResultSetMappingBuilder($this->em); - $rsm->addRootEntityFromClassMetadata('MyNamespace:DDC2256User', 'u'); - $rsm->addJoinedEntityFromClassMetadata('MyNamespace:DDC2256Group', 'g', 'u', 'group', ['id' => 'group_id', 'name' => 'group_name']); - - self::assertCount(1, $this->em->createNativeQuery($sql, $rsm)->getResult()); - } -} - -/** - * @ORM\Entity - * @ORM\Table(name="ddc2256_users") - */ -class DDC2256User -{ - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @ORM\Column(type="string") - */ - public $name; - - /** - * @ORM\ManyToOne(targetEntity=DDC2256Group::class, inversedBy="users")A - * @ORM\JoinColumn(name="group_id") - */ - public $group; -} - -/** - * @ORM\Entity - * @ORM\Table(name="ddc2256_groups") - */ -class DDC2256Group -{ - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="AUTO") - */ - public $id; - - /** - * @ORM\Column(type="string") - */ - public $name; - - /** - * @ORM\OneToMany(targetEntity=DDC2256User::class, mappedBy="group") - */ - public $users; - - public function __construct() - { - $this->users = new \Doctrine\Common\Collections\ArrayCollection(); - } -} diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php index 0120dfb7e23..619621e1486 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php @@ -149,29 +149,6 @@ public function testIsTransient() self::assertFalse($em->getMetadataFactory()->isTransient(CmsArticle::class)); } - /** - * @group DDC-1512 - */ - public function testIsTransientEntityNamespace() - { - $cmf = new ClassMetadataFactory(); - $driver = $this->createMock(MappingDriver::class); - $driver->expects($this->at(0)) - ->method('isTransient') - ->with($this->equalTo(CmsUser::class)) - ->will($this->returnValue(true)); - $driver->expects($this->at(1)) - ->method('isTransient') - ->with($this->equalTo(CmsArticle::class)) - ->will($this->returnValue(false)); - - $em = $this->createEntityManager($driver); - $em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); - - self::assertTrue($em->getMetadataFactory()->isTransient('CMS:CmsUser')); - self::assertFalse($em->getMetadataFactory()->isTransient('CMS:CmsArticle')); - } - public function testAddDefaultDiscriminatorMap() { $cmf = new ClassMetadataFactory(); diff --git a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php index 3989b57102c..db57ba995c3 100644 --- a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php +++ b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php @@ -92,13 +92,6 @@ public function testRejectsInvalidDQL($dql) { $this->expectException(QueryException::class); - $this->em->getConfiguration()->setEntityNamespaces( - [ - 'Unknown' => 'Unknown', - 'CMS' => 'Doctrine\Tests\Models\CMS' - ] - ); - $this->parseDql($dql); } @@ -116,19 +109,12 @@ public function invalidDQL() /* Checks for invalid AbstractSchemaName */ ['SELECT u FROM UnknownClass u'], // unknown - ['SELECT u FROM Unknown\Class u'], // unknown with namespace ['SELECT u FROM \Unknown\Class u'], // unknown, leading backslash ['SELECT u FROM Unknown\\\\Class u'], // unknown, syntactically bogus (duplicate \\) ['SELECT u FROM Unknown\Class\ u'], // unknown, syntactically bogus (trailing \) - ['SELECT u FROM Unknown:Class u'], // unknown, with namespace alias ['SELECT u FROM Unknown::Class u'], // unknown, with PAAMAYIM_NEKUDOTAYIM - ['SELECT u FROM Unknown:Class:Name u'], // unknown, with invalid namespace alias - ['SELECT u FROM UnknownClass: u'], // unknown, with invalid namespace alias - ['SELECT u FROM Unknown:Class: u'], // unknown, with invalid namespace alias ['SELECT u FROM Doctrine\Tests\Models\CMS\\\\CmsUser u'], // syntactically bogus (duplicate \\)array('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser\ u'), // syntactically bogus (trailing \) ['SELECT u FROM CMS::User u'], - ['SELECT u FROM CMS:User: u'], - ['SELECT u FROM CMS:User:Foo u'], /* Checks for invalid AliasResultVariable */ ['SELECT \'foo\' AS \foo FROM Doctrine\Tests\Models\CMS\CmsUser u'], diff --git a/tests/Doctrine/Tests/ORM/Query/ParserTest.php b/tests/Doctrine/Tests/ORM/Query/ParserTest.php index cb13ee6dd71..237644a39e5 100644 --- a/tests/Doctrine/Tests/ORM/Query/ParserTest.php +++ b/tests/Doctrine/Tests/ORM/Query/ParserTest.php @@ -47,32 +47,6 @@ public function testAbstractSchemaNameSupportsIdentifier() self::assertEquals(\stdClass::class, $parser->AbstractSchemaName()); } - /** - * @covers \Doctrine\ORM\Query\Parser::AbstractSchemaName - * @group DDC-3715 - */ - public function testAbstractSchemaNameSupportsNamespaceAlias() - { - $parser = $this->createParser('CMS:CmsUser'); - - $parser->getEntityManager()->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS'); - - self::assertEquals(CmsUser::class, $parser->AbstractSchemaName()); - } - - /** - * @covers \Doctrine\ORM\Query\Parser::AbstractSchemaName - * @group DDC-3715 - */ - public function testAbstractSchemaNameSupportsNamespaceAliasWithRelativeClassname() - { - $parser = $this->createParser('Model:CMS\CmsUser'); - - $parser->getEntityManager()->getConfiguration()->addEntityNamespace('Model', 'Doctrine\Tests\Models'); - - self::assertEquals(CmsUser::class, $parser->AbstractSchemaName()); - } - /** * @dataProvider validMatches * @covers Doctrine\ORM\Query\Parser::match