@@ -2323,15 +2323,30 @@ public function testWhereWithArrayConditions()
2323
2323
$ this ->assertSame ('select * from "users" where ("foo" = ? and "bar" = ?) ' , $ builder ->toSql ());
2324
2324
$ this ->assertEquals ([0 => 1 , 1 => 2 ], $ builder ->getBindings ());
2325
2325
2326
+ $ builder = $ this ->getBuilder ();
2327
+ $ builder ->select ('* ' )->from ('users ' )->where ([['foo ' , 1 ], ['bar ' , 2 ]], boolean: 'or ' );
2328
+ $ this ->assertSame ('select * from "users" where ("foo" = ? or "bar" = ?) ' , $ builder ->toSql ());
2329
+ $ this ->assertEquals ([0 => 1 , 1 => 2 ], $ builder ->getBindings ());
2330
+
2326
2331
$ builder = $ this ->getBuilder ();
2327
2332
$ builder ->select ('* ' )->from ('users ' )->where (['foo ' => 1 , 'bar ' => 2 ]);
2328
2333
$ this ->assertSame ('select * from "users" where ("foo" = ? and "bar" = ?) ' , $ builder ->toSql ());
2329
2334
$ this ->assertEquals ([0 => 1 , 1 => 2 ], $ builder ->getBindings ());
2330
2335
2336
+ $ builder = $ this ->getBuilder ();
2337
+ $ builder ->select ('* ' )->from ('users ' )->where (['foo ' => 1 , 'bar ' => 2 ], boolean: 'or ' );
2338
+ $ this ->assertSame ('select * from "users" where ("foo" = ? or "bar" = ?) ' , $ builder ->toSql ());
2339
+ $ this ->assertEquals ([0 => 1 , 1 => 2 ], $ builder ->getBindings ());
2340
+
2331
2341
$ builder = $ this ->getBuilder ();
2332
2342
$ builder ->select ('* ' )->from ('users ' )->where ([['foo ' , 1 ], ['bar ' , '< ' , 2 ]]);
2333
2343
$ this ->assertSame ('select * from "users" where ("foo" = ? and "bar" < ?) ' , $ builder ->toSql ());
2334
2344
$ this ->assertEquals ([0 => 1 , 1 => 2 ], $ builder ->getBindings ());
2345
+
2346
+ $ builder = $ this ->getBuilder ();
2347
+ $ builder ->select ('* ' )->from ('users ' )->where ([['foo ' , 1 ], ['bar ' , '< ' , 2 ]], boolean: 'or ' );
2348
+ $ this ->assertSame ('select * from "users" where ("foo" = ? or "bar" < ?) ' , $ builder ->toSql ());
2349
+ $ this ->assertEquals ([0 => 1 , 1 => 2 ], $ builder ->getBindings ());
2335
2350
}
2336
2351
2337
2352
public function testNestedWheres ()
0 commit comments