From adb69101c209c97bf68312cbe968d9bb10367dc9 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Thu, 23 Apr 2026 14:56:23 +0200 Subject: [PATCH] fix(oauth): align stable31 oauth tests with rotateToken backport Signed-off-by: Julien Veyssier --- .../Controller/OauthApiControllerTest.php | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/apps/oauth2/tests/Controller/OauthApiControllerTest.php b/apps/oauth2/tests/Controller/OauthApiControllerTest.php index 0c384dc55e7..b83a17ed07d 100644 --- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php +++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php @@ -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',