mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Doctrine 2 Doctrine\ORM\Persisters\Entity\BasicEntityPersister::getSelectSQL() method issue #5596
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kbora504 on GitHub (Jul 1, 2017).
Originally assigned to: @Ocramius on GitHub.
There seems to be a bug in method
public function getSelectSQL($criteria, $assoc = null, $lockMode = null, $limit = null, $offset = null, array $orderBy = null)
As per documentation of Doctrine\ORM\Persisters\Entity\EntityPersister the $criteria parameter should be of type array; so, the below code
will never execute
$this->getSelectConditionCriteriaSQL($criteria)statement, because it is always of type array. Please fix this, so that it accepts single criteria object too.++ Exception
@Ocramius commented on GitHub (Jul 1, 2017):
@kbora504 could you please write a failing test case that demonstrates the issue?
@kbora504 commented on GitHub (Jul 2, 2017):
It is very obvious from code written. Just check the passed parameter type is array and we are checking for
instanceof Criteria.@Ocramius commented on GitHub (Jul 2, 2017):
It doesn't really matter from our perspective: tests verify the behavior and prevent regressions. No tests = no fix/merge ;-)
@kbora504 commented on GitHub (Jul 2, 2017):
@Ocramius I understand your point. But how can I write test case for a satement inside function?
:(
@Ocramius commented on GitHub (Jul 2, 2017):
@kbora504 you got a stack trace there: how did you get to that failure? Can you isolate it and make an example that reproduces the problem? See
388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticketfor examples