Skip to content

Commit fbaeff5

Browse files
committed
Test that query time is expressed in milliseconds
1 parent 32faf93 commit fbaeff5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/ConnectionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ public function testQueryLog()
289289
DB::table('items')->get();
290290
$this->assertCount(1, $logs = DB::getQueryLog());
291291
$this->assertJsonStringEqualsJsonString('{"find":"items","filter":{}}', $logs[0]['query']);
292+
$this->assertLessThan(10, $logs[0]['time'], 'Query time is in milliseconds');
293+
$this->assertGreaterThan(0.01, $logs[0]['time'], 'Query time is in milliseconds');
292294

293295
DB::table('items')->insert(['id' => $id = new ObjectId(), 'name' => 'test']);
294296
$this->assertCount(2, $logs = DB::getQueryLog());

0 commit comments

Comments
 (0)