mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Added token refresh for GitLab to support GitLab 15+ (#10988)
Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
This commit is contained in:
parent
41a13fa0a1
commit
41d6467b3b
6 changed files with 131 additions and 7 deletions
|
@ -30,6 +30,8 @@ class GitLabTest extends TestCase
|
|||
private $origin = 'gitlab.com';
|
||||
/** @var string */
|
||||
private $token = 'gitlabtoken';
|
||||
/** @var string */
|
||||
private $refreshtoken = 'gitlabrefreshtoken';
|
||||
|
||||
public function testUsernamePasswordAuthenticationFlow(): void
|
||||
{
|
||||
|
@ -54,7 +56,7 @@ class GitLabTest extends TestCase
|
|||
|
||||
$httpDownloader = $this->getHttpDownloaderMock();
|
||||
$httpDownloader->expects(
|
||||
[['url' => sprintf('http://%s/oauth/token', $this->origin), 'body' => sprintf('{"access_token": "%s", "token_type": "bearer", "expires_in": 7200}', $this->token)]],
|
||||
[['url' => sprintf('http://%s/oauth/token', $this->origin), 'body' => sprintf('{"access_token": "%s", "refresh_token": "%s", "token_type": "bearer", "expires_in": 7200, "created_at": 0}', $this->token, $this->refreshtoken)]],
|
||||
true
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue