Open kbora504 opened 7 years ago
@kbora504 could you please write a failing test case that demonstrates the issue?
It is very obvious from code written. Just check the passed parameter type is array and we are checking for instanceof Criteria
.
It doesn't really matter from our perspective: tests verify the behavior and prevent regressions. No tests = no fix/merge ;-)
@Ocramius I understand your point. But how can I write test case for a satement inside function? :(
@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 https://github.com/doctrine/doctrine2/tree/388afb46d0cb3ed0c51332e8df0de9e942c2690b/tests/Doctrine/Tests/ORM/Functional/Ticket for examples
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