Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Call to undefined method TiMacDonald\Log\ChannelFake::flushSharedContext() #52

Open
luke83 opened this issue Aug 8, 2024 · 1 comment

Comments

@luke83
Copy link

luke83 commented Aug 8, 2024

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: laravel/framework@864ef6a

As workaround i added this to TiMacDonald\Log\LogFake:

   /**
     * Flush the shared context.
     *
     * @return array
     */
    public function flushSharedContext()
    {
        $this->sharedContext = [];

        return $this;
    }
@epic-64
Copy link

epic-64 commented Sep 27, 2024

Having the same issue, this prevents us from upgrading to Laravel 10, which calls $app['log']->flushSharedContext(); within QueueServiceProvider::registerWorker()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants