diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6699Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6699Test.php new file mode 100644 index 00000000000..53b6c0336a2 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6699Test.php @@ -0,0 +1,38 @@ +useModelSet('cms'); + parent::setUp(); + } + + public function testMixedParametersWithZeroNumber() + { + $qb = $this->_em->createQueryBuilder() + ->select('u') + ->from(CmsUser::class, 'u') + ->andWhere('u.email = :email') + ->andWhere('u.id = ?0'); + $query = $qb->getQuery(); + + $query->setParameter('email', 'bar'); + $query->setParameter(0, 0); + + $query->execute(); + + $this->assertSame(2, $query->getParameters()->count()); + $this->assertSame(0, $query->getParameter(0)->getValue()); + $this->assertSame('bar', $query->getParameter('email')->getValue()); + } +} +