Skip to content

Commit 9c16ecb

Browse files
committed
fix(oauth): align stable29 oauth tests with rotateToken backport
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent f10dda7 commit 9c16ecb

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

apps/oauth2/tests/Controller/OauthApiControllerTest.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,12 @@ public function testRefreshTokenValidAppToken() {
419419
$this->accessTokenMapper->expects($this->once())
420420
->method('rotateToken')
421421
->with(
422-
$this->callback(function (AccessToken $token) {
423-
return $token->getHashedCode() === hash('sha512', 'random128') &&
424-
$token->getEncryptedToken() === 'newEncryptedToken';
425-
})
426-
);
422+
21,
423+
'validrefresh',
424+
'random128',
425+
'newEncryptedToken',
426+
false,
427+
)->willReturn(1);
427428

428429
$expected = new JSONResponse([
429430
'access_token' => 'random72',
@@ -528,11 +529,12 @@ public function testRefreshTokenValidAppTokenBasicAuth() {
528529
$this->accessTokenMapper->expects($this->once())
529530
->method('rotateToken')
530531
->with(
531-
$this->callback(function (AccessToken $token) {
532-
return $token->getHashedCode() === hash('sha512', 'random128') &&
533-
$token->getEncryptedToken() === 'newEncryptedToken';
534-
})
535-
);
532+
21,
533+
'validrefresh',
534+
'random128',
535+
'newEncryptedToken',
536+
false,
537+
)->willReturn(1);
536538

537539
$expected = new JSONResponse([
538540
'access_token' => 'random72',
@@ -640,11 +642,12 @@ public function testRefreshTokenExpiredAppToken() {
640642
$this->accessTokenMapper->expects($this->once())
641643
->method('rotateToken')
642644
->with(
643-
$this->callback(function (AccessToken $token) {
644-
return $token->getHashedCode() === hash('sha512', 'random128') &&
645-
$token->getEncryptedToken() === 'newEncryptedToken';
646-
})
647-
);
645+
21,
646+
'validrefresh',
647+
'random128',
648+
'newEncryptedToken',
649+
false,
650+
)->willReturn(1);
648651

649652
$expected = new JSONResponse([
650653
'access_token' => 'random72',

0 commit comments

Comments
 (0)