diff --git a/tests/Listeners/FlushLogContextTest.php b/tests/Listeners/FlushLogContextTest.php new file mode 100644 index 000000000..20c93cfcc --- /dev/null +++ b/tests/Listeners/FlushLogContextTest.php @@ -0,0 +1,32 @@ +markTestSkipped('Shared context is only supported in Laravel 9+'); + } + + [$app, $worker, $client] = $this->createOctaneContext([ + Request::create('/', 'GET'), + ]); + $app['router']->middleware('web')->get('/', function () { + // .. + }); + $log = $app['log']; + $log->shareContext(['shared' => 'context']); + + $this->assertSame(['shared' => 'context'], $log->sharedContext()); + + $worker->run(); + + $this->assertSame([], $log->sharedContext()); + } +}