Example #1
0
 function test_twoParams()
 {
     $query = new SQL_Query('table');
     $query->addWhere(2, '=', 2);
     // test this ...
     $query->addWhere(new SQL_Condition(1, '=', 1), 'OR');
     $cond = new SQL_Condition(2, '=', 2);
     $cond->add(new SQL_Condition(1, '=', 1), 'OR');
     $this->assertEquals($cond, $query->getWhere());
 }
Example #2
0
 /**
  * test if the condition renders properly when two parameters are given
  *
  */
 function test_twoParams()
 {
     $cond = new SQL_Condition('id', '=', 2);
     // we actually check this here
     $cond->add(new SQL_Condition('id', '<>', 1), 'OR');
     $ren = new $this->_renderer(new SQL_Query());
     $this->assertStringEquals('id = 2 OR ( id <> 1 )', $ren->renderCondition($cond));
 }