Skip to content

Commit

Permalink
Fix compatibility with DBAL 2.8 where OFFSET 0 is no longer generated (
Browse files Browse the repository at this point in the history
  • Loading branch information
Majkl578 committed Sep 23, 2018
1 parent b9feae0 commit 2df7444
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,13 @@ public function testLimitAndOffsetFromQueryClass() : void
->setMaxResults(10)
->setFirstResult(0);

self::assertEquals(
'SELECT t0."id" AS c0, t0."status" AS c1, t0."username" AS c2, t0."name" AS c3, t0."email_id" AS c4 FROM "cms_users" t0 LIMIT 10 OFFSET 0',
$q->getSql()
// DBAL 2.8+ doesn't add OFFSET part when offset is 0
self::assertThat(
$q->getSql(),
self::logicalOr(
self::identicalTo('SELECT t0."id" AS c0, t0."status" AS c1, t0."username" AS c2, t0."name" AS c3, t0."email_id" AS c4 FROM "cms_users" t0 LIMIT 10'),
self::identicalTo('SELECT t0."id" AS c0, t0."status" AS c1, t0."username" AS c2, t0."name" AS c3, t0."email_id" AS c4 FROM "cms_users" t0 LIMIT 10 OFFSET 0')
)
);
}

Expand Down

0 comments on commit 2df7444

Please sign in to comment.