-
Notifications
You must be signed in to change notification settings - Fork 642
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
Add issueStatelessChannelToken test #607
Add issueStatelessChannelToken test #607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
body: json_encode(['access_token' => 'accessToken', 'expires_in' => 30, 'token_type' => 'Bearer',]), | ||
)); | ||
$api = new ChannelAccessTokenApi($client); | ||
$response = $api->issueStatelessChannelToken("client_credentials", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about explicitly using required arguments to work tests even if new optional argument is required?
issueStatelessChannelToken(grantType: "client_credentials", clientId: "1234", clientSecret: "channelSecret")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll do that. In fact, I think that this is also the more common use case for users.
@@ -0,0 +1,59 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that since it was a test for a different API class, it should be in a separate test class 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
/oauth2/v3/token
requires only 3 parameters, but client requires 5 parameters. Our client must work even if some of arguments are passednull
likeclient.issueStatelessChannelToken("client_credentials", null, null, "1234", "clientSecret")
. This change adds a test to verify this.