From 24d8e942804d1f1ea04db6b5d491e0286576ecf7 Mon Sep 17 00:00:00 2001 From: beberlei Date: Sun, 28 Mar 2010 10:30:43 +0000 Subject: [PATCH] [2.0] DDC-478 - Fix QueryBuilder Expr\Between Support --- lib/Doctrine/ORM/Query/Expr.php | 2 +- tests/Doctrine/Tests/ORM/Query/ExprTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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()