Skip to content

Commit

Permalink
test: add limit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Reasno committed Sep 27, 2020
1 parent 67ad06d commit f433a37
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Cases/MongoDBTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ public function testFind()
});
}

public function testLimit() {
\Swoole\Coroutine\run(function () {
$client = make(MongoClient::class);
$collection = $client->database('testing')->collection('unit');
for ($i = 0; $i < 75; $i++) {
$collection->insertOne(['foo' => 'bar', 'tid' => 0]);
}
$result = $collection->find(['foo' => 'bar'], ['skip' => 0, 'limit' => 15]);
$this->assertCount(15, $result);
});
}

public function testDecimalKeys()
{
\Swoole\Coroutine\run(function () {
Expand Down

0 comments on commit f433a37

Please sign in to comment.