Skip to content

Commit ee70178

Browse files
authored
Merge pull request #12287 from greg0ire/more-order-by
Add ORDER BY clause to more test cases
2 parents ffa50a7 + 01c178b commit ee70178

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/Tests/ORM/Functional/QueryTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,9 @@ public function testToIterableWithMixedResultArbitraryJoinsScalars(): void
474474
$this->_em->flush();
475475
$this->_em->clear();
476476

477-
$query = $this->_em->createQuery('select a, u, a.topic, a.text from ' . CmsArticle::class . ' a, ' . CmsUser::class . ' u WHERE a.user = u ');
477+
$query = $this->_em->createQuery(
478+
'select a, u, a.topic, a.text from ' . CmsArticle::class . ' a, ' . CmsUser::class . ' u WHERE a.user = u order by a.id asc',
479+
);
478480
$result = $query->toIterable();
479481

480482
$it = iterator_to_array($result);
@@ -517,7 +519,9 @@ public function testToIterableWithMixedResultScalarsOnly(): void
517519
$this->_em->flush();
518520
$this->_em->clear();
519521

520-
$query = $this->_em->createQuery('select a.topic, a.text from ' . CmsArticle::class . ' a ');
522+
$query = $this->_em->createQuery(
523+
'select a.topic, a.text from ' . CmsArticle::class . ' a order by a.id asc',
524+
);
521525
$result = $query->toIterable();
522526

523527
$it = iterator_to_array($result);
@@ -545,7 +549,9 @@ public function testIterateResultClearEveryCycle(): void
545549
$this->_em->flush();
546550
$this->_em->clear();
547551

548-
$query = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a');
552+
$query = $this->_em->createQuery(
553+
'select a from Doctrine\Tests\Models\CMS\CmsArticle a order by a.id asc',
554+
);
549555

550556
$articles = $query->toIterable();
551557
$iteratedCount = 0;

0 commit comments

Comments
 (0)