[8.x] Add a Passport Client factory to Passport publishing #1171
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the help documentation for 6.x and up there is reference in the testing section to test Client access with the method
Passport::actingAsClient
and that it takes a Client model created by a factory to be passed in. https://laravel.com/docs/6.x/passport#testingJust trying that code out of the box fails since there is no published asset for a
Laravel\Passport\Client
factory. The user is left to make one on their own.This will publish a Client factory that the user can use for this.
I don't believe it will break any existing features as it is just publishing a factory for the user. It could possibly overwrite one the user has already created if it was the same filename?
I think it will make testing this feature easier for Laravel users as they don't have to reference the
oauth_clients
table and create the factory themselves.I don't have any tests included as I am not sure how to test the publish functionality and it seems the other publishes are not tested. If you would like me to write some tests please let me know. I could try harder to find a way to test that.
Thank you!