We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0add3ab commit 21d5fb3Copy full SHA for 21d5fb3
docs/includes/fundamentals/read-operations/ReadOperationsTest.php
@@ -9,6 +9,11 @@
9
use MongoDB\Driver\ReadPreference;
10
use MongoDB\Laravel\Tests\TestCase;
11
12
+use function json_encode;
13
+use function ob_flush;
14
+
15
+use const JSON_PRETTY_PRINT;
16
17
class ReadOperationsTest extends TestCase
18
{
19
protected function setUp(): void
@@ -198,8 +203,13 @@ public function testQueryLog(): void
198
203
Movie::where('imdb.rating', '>', 8.5)->get();
199
204
200
205
$logs = DB::connection('mongodb')->getQueryLog();
206
+ foreach ($logs as $log) {
207
+ echo json_encode($log, JSON_PRETTY_PRINT);
208
+ }
201
209
// end-query-log
202
210
211
+ ob_flush();
212
+ $logs = DB::connection('mongodb')->getQueryLog();
213
$this->assertNotNull($logs);
214
}
215
0 commit comments