fix(oauth): align stable31 oauth tests with rotateToken backport

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
Julien Veyssier 2026-04-23 14:56:23 +02:00
parent dbc976b56b
commit adb69101c2

View file

@ -399,11 +399,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',
@ -508,11 +509,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',
@ -620,11 +622,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',