Closed systemsolutionweb closed 1 year ago
Same as #1519 Stub client on guard when calling Passport::actingAsClient()
I'm trying testing a package laravel 9.x with passport 10.x (it has support for 10.x and 11.x)
This PR changes the Passport::actingAsClient() method. Currently when stubbing the client via Passport, the guard doesn't actually reflect the stub:
>>> $client = Laravel\Passport\Database\Factories\ClientFactory::new()->createOne() => Laravel\Passport\Client {#4807} >>> Laravel\Passport\Passport::actingAsClient($client) => Laravel\Passport\Client {#4807} >>> auth()->guard('api')->client() => null
After this PR the following happens:
>>> $client = Laravel\Passport\Database\Factories\ClientFactory::new()->createOne() => Laravel\Passport\Client {#4807} >>> Laravel\Passport\Passport::actingAsClient($client, [], 'api') => Laravel\Passport\Client {#4807} >>> auth()->guard('api')->client() => Laravel\Passport\Client {#4807}
I'm fairly sure this won't get merged 😖
Same as #1519 Stub client on guard when calling Passport::actingAsClient()
I'm trying testing a package laravel 9.x with passport 10.x (it has support for 10.x and 11.x)
This PR changes the Passport::actingAsClient() method. Currently when stubbing the client via Passport, the guard doesn't actually reflect the stub:
After this PR the following happens:
I'm fairly sure this won't get merged 😖