/** * Creates a lower-than-equal comparison expression with the given arguments. * First argument is considered the left expression and the second is the right expression. * When converted to string, it will generated a <left expr> <= <right expr>. Example: * * [php] * // u.id <= ? * $q->where($q->expr()->lte('u.id', '?')); * * @param mixed $x The left expression. * @param mixed $y The right expression. * * @return string */ public function lte($x, $y) { $x = $this->helper->quoteColumnName($x); $y = $this->helper->quoteColumnName($y); return $this->expressionBuilder->lte($x, $y); }
/** * @dataProvider dataComparisons * * @param mixed $input1 * @param bool $isInput1Literal * @param mixed $input2 * @param bool $isInput2Literal */ public function testLowerThanEquals($input1, $isInput1Literal, $input2, $isInput2Literal) { list($doctrineInput1, $ocInput1) = $this->helpWithLiteral($input1, $isInput1Literal); list($doctrineInput2, $ocInput2) = $this->helpWithLiteral($input2, $isInput2Literal); $this->assertEquals($this->doctrineExpressionBuilder->lte($doctrineInput1, $doctrineInput2), $this->expressionBuilder->lte($ocInput1, $ocInput2)); }