@@ -58,9 +58,9 @@ public function testGenerateTokenWithAdminRole(): void
5858
5959 $ parsedToken = $ this ->tokenService ->parseToken ($ token );
6060
61- $ this ->assertSame ('admin123 ' , $ parsedToken ->claims ()->get ('uid ' ));
6261 $ this ->assertSame ('admin@example.com ' , $ parsedToken ->claims ()->get ('username ' ));
63- $ this ->assertSame (['ROLE_USER ' , 'ROLE_ADMIN ' ], $ parsedToken ->claims ()->get ('roles ' ));
62+ $ this ->assertFalse ($ parsedToken ->claims ()->has ('uid ' ));
63+ $ this ->assertFalse ($ parsedToken ->claims ()->has ('roles ' ));
6464 }
6565
6666 public function testParseValidToken (): void
@@ -70,9 +70,7 @@ public function testParseValidToken(): void
7070 $ token = $ this ->tokenService ->generateToken ($ user );
7171 $ parsedToken = $ this ->tokenService ->parseToken ($ token );
7272
73- $ this ->assertSame ('user456 ' , $ parsedToken ->claims ()->get ('uid ' ));
7473 $ this ->assertSame ('user@example.com ' , $ parsedToken ->claims ()->get ('username ' ));
75- $ this ->assertSame (['ROLE_USER ' ], $ parsedToken ->claims ()->get ('roles ' ));
7674 }
7775
7876 public function testParseInvalidToken (): void
@@ -208,9 +206,7 @@ public function testParseExpiredToken(): void
208206 ->identifiedBy (bin2hex (random_bytes (16 )))
209207 ->issuedAt ($ now ->modify ('-2 hours ' ))
210208 ->expiresAt ($ now ->modify ('-1 hour ' ))
211- ->withClaim ('uid ' , 'user123 ' )
212209 ->withClaim ('username ' , 'test@example.com ' )
213- ->withClaim ('roles ' , ['ROLE_USER ' ])
214210 ->getToken ($ config ->signer (), $ config ->signingKey ())
215211 ->toString ();
216212
0 commit comments