lessThan() public static method

public static lessThan ( $value )
コード例 #1
0
 /**
  * @test
  */
 public function shouldCreateProperSql()
 {
     //given
     $restriction = Restrictions::lessThan(5);
     //when
     $sql = $restriction->toSql('key');
     //then
     $this->assertEquals('key < ?', $sql);
     $this->assertEquals(array(5), $restriction->getValues());
 }
コード例 #2
0
ファイル: WhereClauseTest.php プロジェクト: letsdrink/ouzo
 /**
  * @test
  */
 public function shouldAddParenthesisToListOfRestrictions()
 {
     // when
     $result = WhereClause::create(array('a' => array(Restrictions::equalTo('b'), Restrictions::lessThan('c')), 'b' => 'd'));
     // then
     $this->assertInstanceOf('\\Ouzo\\Db\\WhereClause\\ArrayWhereClause', $result);
     $this->assertEquals('(a = ? OR a < ?) AND b = ?', $result->toSql());
 }