Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ protected function requestToken(string $clientId, string $clientSecret, TokenReq
'Authorization' => sprintf('Basic %s', $credentials),
'Content-Type' => 'application/x-www-form-urlencoded',
],
'body' => http_build_query($token->toArray())
'form_params' => $token->toArray()
]);

$responseTypes = [
Expand Down
15 changes: 12 additions & 3 deletions tests/BaseClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ protected function authenticateByClientCredentials(?ResponseInterface $response
'Authorization' => 'Basic ' . $credentials,
'Content-Type' => 'application/x-www-form-urlencoded'
],
'body' => 'grant_type=client_credentials'
'form_params' => [
'grant_type' => 'client_credentials',
],
])->willReturn($response);

// use the HttpClient mock created in this method for authentication, put the original one back afterwards
Expand Down Expand Up @@ -375,7 +377,11 @@ protected function authenticateByAuthorizationCode(?ResponseInterface $response
'Authorization' => 'Basic ' . $credentials,
'Content-Type' => 'application/x-www-form-urlencoded'
],
'body' => 'grant_type=authorization_code&code=123456&redirect_uri=http%3A%2F%2Fsomeserver.xxx%2Fredirect'
'form_params' => [
'grant_type' => 'authorization_code',
'code' => '123456',
'redirect_uri' => 'http://someserver.xxx/redirect',
],
])->willReturn($response);

// use the HttpClient mock created in this method for authentication, put the original one back afterwards
Expand Down Expand Up @@ -427,7 +433,10 @@ protected function authenticateByRefreshToken(?ResponseInterface $response = nul
'Authorization' => 'Basic ' . $credentials,
'Content-Type' => 'application/x-www-form-urlencoded'
],
'body' => 'grant_type=refresh_token&refresh_token=' . $this->validRefreshToken->getToken()
'form_params' => [
'grant_type' => 'refresh_token',
'refresh_token' => $this->validRefreshToken->getToken(),
],
])->willReturn($response);

// use the HttpClient mock created in this method for authentication, put the original one back afterwards
Expand Down
4 changes: 3 additions & 1 deletion tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ protected function authenticateByClientCredentials()
'Authorization' => 'Basic ' . $credentials,
'Content-Type' => 'application/x-www-form-urlencoded'
],
'body' => 'grant_type=client_credentials'
'form_params' => [
'grant_type' => 'client_credentials',
],
])->willReturn($response);

// use the HttpClient mock created in this method for authentication, put the original one back afterwards
Expand Down
Loading