1
0
mirror of synced 2024-12-15 07:36:03 +03:00

Merge branch 'DBAL-171'

This commit is contained in:
Benjamin Eberlei 2011-11-18 17:42:38 +01:00
commit a0d6d84a4f

View File

@ -462,30 +462,30 @@ class QueryTest extends \Doctrine\Tests\OrmFunctionalTestCase
*/ */
public function testParameterOrder() public function testParameterOrder()
{ {
$user = new CmsUser; $user1 = new CmsUser;
$user->name = 'Benjamin'; $user1->name = 'Benjamin';
$user->username = 'beberlei'; $user1->username = 'beberlei';
$user->status = 'developer'; $user1->status = 'developer';
$this->_em->persist($user); $this->_em->persist($user1);
$user = new CmsUser; $user2 = new CmsUser;
$user->name = 'Roman'; $user2->name = 'Roman';
$user->username = 'romanb'; $user2->username = 'romanb';
$user->status = 'developer'; $user2->status = 'developer';
$this->_em->persist($user); $this->_em->persist($user2);
$user = new CmsUser; $user3 = new CmsUser;
$user->name = 'Jonathan'; $user3->name = 'Jonathan';
$user->username = 'jwage'; $user3->username = 'jwage';
$user->status = 'developer'; $user3->status = 'developer';
$this->_em->persist($user); $this->_em->persist($user3);
$this->_em->flush(); $this->_em->flush();
$this->_em->clear(); $this->_em->clear();
$query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.status = :a AND u.id IN (:b)"); $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.status = :a AND u.id IN (:b)");
$query->setParameters(array( $query->setParameters(array(
'b' => array(1,2,3), 'b' => array($user1->id, $user2->id, $user3->id),
'a' => 'developer', 'a' => 'developer',
)); ));
$result = $query->getResult(); $result = $query->getResult();