Open luke83 opened 3 months ago
When running in tests something like:
LogFake::bind(); $this->artisan('queue:work database --queue=default --once'); Log::assertNothingLogged();
i got:
Error: Call to undefined method TiMacDonald\Log\ChannelFake::flushSharedContext() ./vendor/timacdonald/log-fake/src/LogFake.php:222 ./vendor/laravel/framework/src/Illuminate/Queue/QueueServiceProvider.php:201
it seems related to this feature: https://github.com/laravel/framework/commit/864ef6a3248359b21fd804137f1f0421630415d7
As workaround i added this to TiMacDonald\Log\LogFake:
TiMacDonald\Log\LogFake
/** * Flush the shared context. * * @return array */ public function flushSharedContext() { $this->sharedContext = []; return $this; }
Having the same issue, this prevents us from upgrading to Laravel 10, which calls $app['log']->flushSharedContext(); within QueueServiceProvider::registerWorker()
$app['log']->flushSharedContext();
QueueServiceProvider::registerWorker()
When running in tests something like:
i got:
it seems related to this feature: https://github.com/laravel/framework/commit/864ef6a3248359b21fd804137f1f0421630415d7
As workaround i added this to
TiMacDonald\Log\LogFake
: