I'm using master branch of Doctrine 2. Including an Expr with a numeric 0 value (not a string):
Expr::literal method will return an empty string ('') instead of '0', which causes that this expression be something like:
This makes the query fail. Tracking the issue down I've found this on Expr\Base::add method:
The problem is that empty function returns true if you pass '0', so a call to Expr\Base::add would end on NOT adding '0' to $this->_parts array. That's why it finally returns ''.
I wanted to make the fix for this but I'm having issues running the phing build task. Which are the steps to follow to run the tests? Running phing build task I get on the "test" task:
Could not create task/type: 'nativephpunit'. Make sure that this class has been declared using taskdef / typedef.