From 03d5922996a190a39366064c17992c4a6d4965d7 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 27 May 2012 17:22:16 +0200 Subject: [PATCH] [DDC-1713] Verify EntityRepository#findBy() works with fetching array of values. --- .../Tests/ORM/Functional/EntityRepositoryTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index 603121697..ef754ffb0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -545,5 +545,18 @@ class EntityRepositoryTest extends \Doctrine\Tests\OrmFunctionalTestCase $repo = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsUser'); $repo->findBy(array('status' => 'test'), array('username' => 'INVALID')); } + + /** + * @group DDC-1713 + */ + public function testFindByAssocationArray() + { + $repo = $this->_em->getRepository('Doctrine\Tests\Models\CMS\CmsArticle'); + $data = $repo->findBy(array('user' => array(1, 2, 3))); + + $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]); + } }