From 67b6edca9e639de06c3bea82421014fac4378c4e Mon Sep 17 00:00:00 2001 From: Jan Nedbal Date: Tue, 8 Oct 2024 12:35:24 +0200 Subject: [PATCH] Failing test: omitted dynamic group by wrongly affects result --- .../data/QueryResult/queryBuilderGetQuery.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/Type/Doctrine/data/QueryResult/queryBuilderGetQuery.php b/tests/Type/Doctrine/data/QueryResult/queryBuilderGetQuery.php index c0cf3068..4615d028 100644 --- a/tests/Type/Doctrine/data/QueryResult/queryBuilderGetQuery.php +++ b/tests/Type/Doctrine/data/QueryResult/queryBuilderGetQuery.php @@ -262,6 +262,23 @@ public function testDynamicMethodCall( assertType('mixed', $result); } + public function testDynamicMethodCallInGroupBy( + EntityManagerInterface $em, + Andx $and, + Criteria $criteria, + string $string + ): void + { + $result = $em->createQueryBuilder() + ->select('AVG(m.intColumn) AS average') + ->from(Many::class, 'm') + ->addGroupBy($string) + ->getQuery() + ->getResult(); + + assertType('list', $result); // not nullable, we have GROUP BY present + } +รบ private function createVehicule(): VehicleInterface { return new Truck();