File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2098,6 +2098,11 @@ public function testLatest()
20982098 $ builder = $ this ->getBuilder ();
20992099 $ builder ->select ('* ' )->from ('users ' )->latest ('updated_at ' , 1 );
21002100 $ this ->assertSame ('select * from "users" order by "updated_at" desc limit 1 ' , $ builder ->toSql ());
2101+
2102+ $ builder = $ this ->getBuilder ();
2103+ $ builder ->from ('users ' )->latest (1 );
2104+ $ this ->assertSame ('select * from "users" order by "created_at" desc limit 1 ' , $ builder ->toSql ());
2105+ $ this ->assertSame (1 , $ builder ->limit );
21012106 }
21022107
21032108 public function testOldest ()
@@ -2121,6 +2126,11 @@ public function testOldest()
21212126 $ builder = $ this ->getBuilder ();
21222127 $ builder ->select ('* ' )->from ('users ' )->oldest ('updated_at ' , 1 );
21232128 $ this ->assertSame ('select * from "users" order by "updated_at" asc limit 1 ' , $ builder ->toSql ());
2129+
2130+ $ builder = $ this ->getBuilder ();
2131+ $ builder ->from ('users ' )->oldest (1 );
2132+ $ this ->assertSame ('select * from "users" order by "created_at" asc limit 1 ' , $ builder ->toSql ());
2133+ $ this ->assertSame (1 , $ builder ->limit );
21242134 }
21252135
21262136 public function testInRandomOrderMySql ()
You can’t perform that action at this time.
0 commit comments