예제 #1
0
 public function testSqlInjection()
 {
     $condition = "' OR ''='";
     $result = $this->object->andWhere($condition)->getDbComponent()->getWherePart();
     $compare = " AND (\\' OR \\'\\'=\\')";
     $this->assertEquals($compare, $result);
 }
 public function testWhereAnd()
 {
     $condition = "`field1` > 2";
     $this->object->where($condition);
     $this->object->andWhere("`field2` > 3");
     $result = $this->object->orWhere("`field3` > 4")->getWherePart();
     $compare = " WHERE (`field1` > 2) AND (`field2` > 3) OR (`field3` > 4)";
     $this->assertEquals($compare, $result);
 }