Support the ongoing development of Laravel.io →
Authentication

Hi! I need to test a simple OAuth2 service I am trying to create. However, to test it, I need to mock both $this and a Guzzle StaticClient. I am testing with phpspec. How should I go about doing this?

I tried injecting the StaticClient but I get an error: "could not reflect class Guzzle\Http\StaticClient as it is marked final".

My code is here: http://laravel.io/bin/NmeK

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.