File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
tests/Doctrine/Tests/ORM/Functional Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 77use Doctrine \DBAL \Platforms \PostgreSQLPlatform ;
88use Doctrine \Tests \Models \Company \CompanyEmployee ;
99use Doctrine \Tests \OrmFunctionalTestCase ;
10-
1110use function count ;
1211
1312/**
@@ -204,6 +203,20 @@ public function testOrderWithArithmeticExpressionWithSingleValuedPathExpressionA
204203 $ this ->assertEquals ('Benjamin E. ' , $ result [1 ]->getName ());
205204 }
206205
206+ public function testOrderWithArithmeticExpressionWithLiteralAndResultVariableUsingHiddenResultVariable (): void
207+ {
208+ $ dql = 'SELECT p, p.salary AS HIDDEN s, 1 + s AS HIDDEN _order ' .
209+ 'FROM Doctrine\Tests\Models\Company\CompanyEmployee p ' .
210+ 'ORDER BY _order DESC ' ;
211+
212+ /** @var CompanyEmployee[] $result */
213+ $ result = $ this ->_em ->createQuery ($ dql )->getResult ();
214+
215+ $ this ->assertEquals (2 , count ($ result ));
216+ $ this ->assertEquals ('Guilherme B. ' , $ result [0 ]->getName ());
217+ $ this ->assertEquals ('Benjamin E. ' , $ result [1 ]->getName ());
218+ }
219+
207220 public function generateFixture (): void
208221 {
209222 $ person1 = new CompanyEmployee ();
You can’t perform that action at this time.
0 commit comments