1
0
mirror of synced 2024-12-13 14:56:01 +03:00

[DDC-1068] Fix case-sensitivity problems of first loading of Metadata.

This commit is contained in:
Benjamin Eberlei 2011-03-20 12:35:52 +01:00
parent c77dbd859b
commit ac175d2c40
2 changed files with 11 additions and 1 deletions

View File

@ -63,10 +63,10 @@ class ClassMetadata extends ClassMetadataInfo
*/
public function __construct($entityName)
{
parent::__construct($entityName);
$this->reflClass = new ReflectionClass($entityName);
$this->namespace = $this->reflClass->getNamespaceName();
$this->table['name'] = $this->reflClass->getShortName();
parent::__construct($this->reflClass->getName()); // do not use $entityName, possible case-problems
}
/**

View File

@ -446,4 +446,14 @@ class ClassMetadataTest extends \Doctrine\Tests\OrmTestCase
'query' => 'SELECT u FROM __CLASS__ u WHERE u.id = ?1'
));
}
/**
* @group DDC-1068
*/
public function testClassCaseSensitivity()
{
$user = new \Doctrine\Tests\Models\CMS\CmsUser();
$cm = new ClassMetadata('DOCTRINE\TESTS\MODELS\CMS\CMSUSER');
$this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name);
}
}