diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php index 8587e139c..588333f37 100644 --- a/lib/Doctrine/ORM/Query/Expr.php +++ b/lib/Doctrine/ORM/Query/Expr.php @@ -544,7 +544,7 @@ class Expr */ public function between($val, $x, $y) { - return new Expr\Func('BETWEEN', array($val, $x, $y)); + return $val . ' BETWEEN ' . $x . ' AND ' . $y; } /** diff --git a/tests/Doctrine/Tests/ORM/Query/ExprTest.php b/tests/Doctrine/Tests/ORM/Query/ExprTest.php index 283398792..8a3d966d7 100644 --- a/tests/Doctrine/Tests/ORM/Query/ExprTest.php +++ b/tests/Doctrine/Tests/ORM/Query/ExprTest.php @@ -232,7 +232,7 @@ class ExprTest extends \Doctrine\Tests\OrmTestCase public function testBetweenExpr() { - $this->assertEquals('BETWEEN(u.id, 3, 6)', (string) $this->_expr->between('u.id', 3, 6)); + $this->assertEquals('u.id BETWEEN 3 AND 6', (string) $this->_expr->between('u.id', 3, 6)); } public function testTrimExpr()