diff --git a/test/src/Provider/KeycloakTest.php b/test/src/Provider/KeycloakTest.php index 2e47b7e..f690dca 100644 --- a/test/src/Provider/KeycloakTest.php +++ b/test/src/Provider/KeycloakTest.php @@ -495,17 +495,17 @@ public function testCanDecryptResponseThrowsExceptionIfResponseIsNotAStringAndEn public function testCanDecryptResponseReturnsResponseWhenEncryptionIsUsed() { - - $jwt = JWT::encode( - json_decode( - sprintf( - $this->jwtTemplate, - (new DateTimeImmutable())->add(new DateInterval('PT1H'))->getTimestamp(), - (new DateTimeImmutable())->sub(new DateInterval('P1D'))->getTimestamp(), - (new DateTimeImmutable())->sub(new DateInterval('P1D'))->getTimestamp() - ), - true + $jwtPayload = json_decode( + sprintf( + $this->jwtTemplate, + (new DateTimeImmutable())->add(new DateInterval('PT1H'))->getTimestamp(), + (new DateTimeImmutable())->sub(new DateInterval('P1D'))->getTimestamp(), + (new DateTimeImmutable())->sub(new DateInterval('P1D'))->getTimestamp() ), + true + ); + $jwt = JWT::encode( + $jwtPayload, self::ENCRYPTION_KEY, self::ENCRYPTION_ALGORITHM ); @@ -515,6 +515,8 @@ public function testCanDecryptResponseReturnsResponseWhenEncryptionIsUsed() ->setEncryptionKey(self::ENCRYPTION_KEY); $response = $this->provider->decryptResponse($jwt); + + $this->assertSame($jwtPayload, $response); } } }