From 8a18757d55ae381c962bc06748cc0a5d39f2c8ea Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Mon, 27 Apr 2026 10:43:07 +0200 Subject: [PATCH] fix(oauth): align stable30 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 9683ad28f44..7e955f64016 100644 --- a/apps/oauth2/tests/Controller/OauthApiControllerTest.php +++ b/apps/oauth2/tests/Controller/OauthApiControllerTest.php @@ -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',