Esempio n. 1
0
 public function testJoinMultipleConditions()
 {
     $builder = new BaseBuilder('table1', $this->db);
     $builder->join('table2', "table1.field1 = table2.field2 AND table1.field1 = 'foo' AND table2.field2 = 0", 'LEFT');
     $expectedSQL = "SELECT * FROM \"table1\" LEFT JOIN \"table2\" ON \"table1\".\"field1\" = \"table2\".\"field2\" AND \"table1\".\"field1\" = 'foo' AND \"table2\".\"field2\" = 0";
     $this->assertEquals($expectedSQL, str_replace("\n", ' ', $builder->getCompiledSelect()));
 }