Skip to content

Instantly share code, notes, and snippets.

@doctrinebot
Created December 13, 2015 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctrinebot/114f4860e989197c35e3 to your computer and use it in GitHub Desktop.
Save doctrinebot/114f4860e989197c35e3 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DDC-1040 - https://github.com/doctrine/doctrine2/issues/1630
diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php
index c753960..aef1051 100644
--- a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php
+++ b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php
@@ -313,4 +313,23 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertTrue($result[0]->user instanceof \Doctrine\ORM\Proxy\Proxy);
$this->assertFalse($result[0]->user->__isInitialized__);
}
+
+ /**
+ * @group DDC-1040
+ */
+ public function testSameNamedParameters()
+ {
+ $article = new CmsArticle;
+ $article->topic = "Test";
+ $article->text = "Test";
+ $this->_em->persist($article);
+ $this->_em->flush();
+ $this->_em->clear();
+
+ $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a where a.topic = :topic OR a.text = :topic");
+ $q->setParameter('topic', 'Test');
+
+ $article = $q->getSingleResult();
+ $this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsArticle', $article);
+ }
}
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment