1
0
mirror of synced 2025-03-04 20:03:21 +03:00

Merge branch 'DDC-1683'

This commit is contained in:
Benjamin Eberlei 2012-03-14 20:49:34 +01:00
commit 0e1eff14bc
2 changed files with 12 additions and 1 deletions

View File

@ -562,6 +562,8 @@ class Expr
{
if (is_numeric($literal) && !is_string($literal)) {
return (string) $literal;
} else if (is_bool($literal)) {
return $literal ? "true" : "false";
} else {
return "'" . str_replace("'", "''", $literal) . "'";
}

View File

@ -336,4 +336,13 @@ class ExprTest extends \Doctrine\Tests\OrmTestCase
$orExpr = $this->_expr->orx();
$orExpr->add($this->_expr->quot(5, 2));
}
}
/**
* @group DDC-1683
*/
public function testBooleanLiteral()
{
$this->assertEquals('true', $this->_expr->literal(true));
$this->assertEquals('false', $this->_expr->literal(false));
}
}