diff --git a/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php b/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php index 66184a8a8..52ac8f591 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php @@ -96,6 +96,36 @@ class ProxiesLikeEntitiesTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->_em->flush(); } + /** + * Verifying that proxies can be used without problems as query parameters + */ + public function testFindWithProxyName() + { + $result = $this + ->_em + ->find('Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\Models\CMS\CmsUser', $this->user->getId()); + $this->assertSame($this->user->getId(), $result->getId()); + $this->_em->clear(); + $result = $this + ->_em + ->getReference('Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\Models\CMS\CmsUser', $this->user->getId()); + $this->assertSame($this->user->getId(), $result->getId()); + $this->_em->clear(); + $result = $this + ->_em + ->getRepository('Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\Models\CMS\CmsUser') + ->findOneBy(array('username' => $this->user->username)); + $this->assertSame($this->user->getId(), $result->getId()); + $this->_em->clear(); + $result = $this + ->_em + ->createQuery('SELECT u FROM Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = ?1') + ->setParameter(1, $this->user->getId()) + ->getSingleResult(); + $this->assertSame($this->user->getId(), $result->getId()); + $this->_em->clear(); + } + protected function tearDown() { $this->_em->createQuery('DELETE FROM Doctrine\Tests\Models\CMS\CmsUser u')->execute();