@@ -147,6 +147,7 @@ public function testInvalidTokenWithNbfLeeway()
147147 ];
148148 $ encoded = JWT ::encode ($ payload , 'my_key ' , 'HS256 ' );
149149 $ this ->expectException (BeforeValidException::class);
150+ $ this ->expectExceptionMessage ('Cannot handle token with nbf prior to ' );
150151 JWT ::decode ($ encoded , new Key ('my_key ' , 'HS256 ' ));
151152 }
152153
@@ -176,6 +177,7 @@ public function testValidTokenWithNbfMicrotime()
176177 public function testInvalidTokenWithNbfMicrotime ()
177178 {
178179 $ this ->expectException (BeforeValidException::class);
180+ $ this ->expectExceptionMessage ('Cannot handle token with nbf prior to ' );
179181 $ payload = [
180182 'message ' => 'abc ' ,
181183 'nbf ' => microtime (true ) + 20 , // use microtime in the future
@@ -211,6 +213,7 @@ public function testInvalidTokenWithIatLeeway()
211213 ];
212214 $ encoded = JWT ::encode ($ payload , 'my_key ' , 'HS256 ' );
213215 $ this ->expectException (BeforeValidException::class);
216+ $ this ->expectExceptionMessage ('Cannot handle token with iat prior to ' );
214217 JWT ::decode ($ encoded , new Key ('my_key ' , 'HS256 ' ));
215218 }
216219
@@ -228,6 +231,7 @@ public function testValidTokenWithIatMicrotime()
228231 public function testInvalidTokenWithIatMicrotime ()
229232 {
230233 $ this ->expectException (BeforeValidException::class);
234+ $ this ->expectExceptionMessage ('Cannot handle token with iat prior to ' );
231235 $ payload = [
232236 'message ' => 'abc ' ,
233237 'iat ' => microtime (true ) + 20 , // use microtime in the future
0 commit comments