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

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
Julien Veyssier 2026-04-27 10:43:07 +02:00
parent eb9c2e744d
commit 8a18757d55
No known key found for this signature in database
GPG key ID: 4141FEE162030638

View file

@ -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',