mirror of
https://github.com/nextcloud/server.git
synced 2026-05-16 10:30:10 -04:00
fix(oauth): align stable30 oauth tests with rotateToken backport
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
eb9c2e744d
commit
8a18757d55
1 changed files with 18 additions and 15 deletions
|
|
@ -400,11 +400,12 @@ class OauthApiControllerTest extends TestCase {
|
|||
$this->accessTokenMapper->expects($this->once())
|
||||
->method('rotateToken')
|
||||
->with(
|
||||
$this->callback(function (AccessToken $token) {
|
||||
return $token->getHashedCode() === hash('sha512', 'random128') &&
|
||||
$token->getEncryptedToken() === 'newEncryptedToken';
|
||||
})
|
||||
);
|
||||
21,
|
||||
'validrefresh',
|
||||
'random128',
|
||||
'newEncryptedToken',
|
||||
false,
|
||||
)->willReturn(1);
|
||||
|
||||
$expected = new JSONResponse([
|
||||
'access_token' => 'random72',
|
||||
|
|
@ -509,11 +510,12 @@ class OauthApiControllerTest extends TestCase {
|
|||
$this->accessTokenMapper->expects($this->once())
|
||||
->method('rotateToken')
|
||||
->with(
|
||||
$this->callback(function (AccessToken $token) {
|
||||
return $token->getHashedCode() === hash('sha512', 'random128') &&
|
||||
$token->getEncryptedToken() === 'newEncryptedToken';
|
||||
})
|
||||
);
|
||||
21,
|
||||
'validrefresh',
|
||||
'random128',
|
||||
'newEncryptedToken',
|
||||
false,
|
||||
)->willReturn(1);
|
||||
|
||||
$expected = new JSONResponse([
|
||||
'access_token' => 'random72',
|
||||
|
|
@ -621,11 +623,12 @@ class OauthApiControllerTest extends TestCase {
|
|||
$this->accessTokenMapper->expects($this->once())
|
||||
->method('rotateToken')
|
||||
->with(
|
||||
$this->callback(function (AccessToken $token) {
|
||||
return $token->getHashedCode() === hash('sha512', 'random128') &&
|
||||
$token->getEncryptedToken() === 'newEncryptedToken';
|
||||
})
|
||||
);
|
||||
21,
|
||||
'validrefresh',
|
||||
'random128',
|
||||
'newEncryptedToken',
|
||||
false,
|
||||
)->willReturn(1);
|
||||
|
||||
$expected = new JSONResponse([
|
||||
'access_token' => 'random72',
|
||||
|
|
|
|||
Loading…
Reference in a new issue