-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix compatibility with DBAL 2.8 (doctrine/dbal#3157) #7290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, I'd suggest to add more details to the commit message or add a comment in the code. It might be complicated to understand this after some time.
@@ -823,7 +823,13 @@ public function testLimitAndOffsetFromQueryClass() | |||
->setMaxResults(10) | |||
->setFirstResult(0); | |||
|
|||
$this->assertEquals('SELECT c0_.id AS id_0, c0_.status AS status_1, c0_.username AS username_2, c0_.name AS name_3, c0_.email_id AS email_id_4 FROM cms_users c0_ LIMIT 10 OFFSET 0', $q->getSql()); | |||
self::assertThat( | |||
$q->getSql(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it use DBAL\QueryBuilder
internally? If yes, maybe the test could be improved by only making sure that the values passed to Query::setMaxResults()
and Query::setFirstResult()
are passed down to the QueryBuilder
as is.
E.g. if instead of getSql()
we could get the internal QueryBuilder
and check its state, we could get rid of the dependency on SQL.
If it's not possible, then I'm fine with this solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not using DBAL builder, but SQL walker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morozov it doesn't using the query builder internally but rather a compiles a DQL and translates it into SQL using a Query
object.
c85b547
to
ac1e1c7
Compare
@lcobucci Added comment + reworded. |
Meh, Scrutinizer is not working properly... :S |
Forward-compat for doctrine/dbal#3157.