File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1508,6 +1508,27 @@ public function testOldest()
1508
1508
$ this ->assertSame ('select * from "users" order by "updated_at" asc ' , $ builder ->toSql ());
1509
1509
}
1510
1510
1511
+ public function testInRandomOrderMySql ()
1512
+ {
1513
+ $ builder = $ this ->getBuilder ();
1514
+ $ builder ->select ('* ' )->from ('users ' )->inRandomOrder ();
1515
+ $ this ->assertSame ('select * from "users" order by RANDOM() ' , $ builder ->toSql ());
1516
+ }
1517
+
1518
+ public function testInRandomOrderPostgres ()
1519
+ {
1520
+ $ builder = $ this ->getPostgresBuilder ();
1521
+ $ builder ->select ('* ' )->from ('users ' )->inRandomOrder ();
1522
+ $ this ->assertSame ('select * from "users" order by RANDOM() ' , $ builder ->toSql ());
1523
+ }
1524
+
1525
+ public function testInRandomOrderSqlServer ()
1526
+ {
1527
+ $ builder = $ this ->getSqlServerBuilder ();
1528
+ $ builder ->select ('* ' )->from ('users ' )->inRandomOrder ();
1529
+ $ this ->assertSame ('select * from [users] order by NEWID() ' , $ builder ->toSql ());
1530
+ }
1531
+
1511
1532
public function testOrderBysSqlServer ()
1512
1533
{
1513
1534
$ builder = $ this ->getSqlServerBuilder ();
You can’t perform that action at this time.
0 commit comments