@@ -147,6 +147,7 @@ public function testInvalidTokenWithNbfLeeway()
147
147
];
148
148
$ encoded = JWT ::encode ($ payload , 'my_key ' , 'HS256 ' );
149
149
$ this ->expectException (BeforeValidException::class);
150
+ $ this ->expectExceptionMessage ('Cannot handle token with nbf prior to ' );
150
151
JWT ::decode ($ encoded , new Key ('my_key ' , 'HS256 ' ));
151
152
}
152
153
@@ -176,6 +177,7 @@ public function testValidTokenWithNbfMicrotime()
176
177
public function testInvalidTokenWithNbfMicrotime ()
177
178
{
178
179
$ this ->expectException (BeforeValidException::class);
180
+ $ this ->expectExceptionMessage ('Cannot handle token with nbf prior to ' );
179
181
$ payload = [
180
182
'message ' => 'abc ' ,
181
183
'nbf ' => microtime (true ) + 20 , // use microtime in the future
@@ -211,6 +213,7 @@ public function testInvalidTokenWithIatLeeway()
211
213
];
212
214
$ encoded = JWT ::encode ($ payload , 'my_key ' , 'HS256 ' );
213
215
$ this ->expectException (BeforeValidException::class);
216
+ $ this ->expectExceptionMessage ('Cannot handle token with iat prior to ' );
214
217
JWT ::decode ($ encoded , new Key ('my_key ' , 'HS256 ' ));
215
218
}
216
219
@@ -228,6 +231,7 @@ public function testValidTokenWithIatMicrotime()
228
231
public function testInvalidTokenWithIatMicrotime ()
229
232
{
230
233
$ this ->expectException (BeforeValidException::class);
234
+ $ this ->expectExceptionMessage ('Cannot handle token with iat prior to ' );
231
235
$ payload = [
232
236
'message ' => 'abc ' ,
233
237
'iat ' => microtime (true ) + 20 , // use microtime in the future
0 commit comments