Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Nov 17, 2021
1 parent 5aa9aba commit 209c12f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/Database/DatabaseQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,14 @@ public function testLimitsAndOffsets()
$builder->select('*')->from('users')->offset(5)->limit(10);
$this->assertSame('select * from "users" limit 10 offset 5', $builder->toSql());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->limit(null);
$this->assertSame('select * from "users"', $builder->toSql());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->limit(0);
$this->assertSame('select * from "users" limit 0', $builder->toSql());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->skip(5)->take(10);
$this->assertSame('select * from "users" limit 10 offset 5', $builder->toSql());
Expand All @@ -1262,8 +1270,12 @@ public function testLimitsAndOffsets()
$this->assertSame('select * from "users" offset 0', $builder->toSql());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->limit(null);
$this->assertSame('select * from "users"', $builder->toSql());
$builder->select('*')->from('users')->skip(null)->take(null);
$this->assertSame('select * from "users" offset 0', $builder->toSql());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->skip(5)->take(null);
$this->assertSame('select * from "users" offset 5', $builder->toSql());
}

public function testForPage()
Expand Down

0 comments on commit 209c12f

Please sign in to comment.