@@ -84,6 +84,7 @@ public function testValidTokenWithLeeway()
84
84
$ encoded = JWT ::encode ($ payload , 'my_key ' );
85
85
$ decoded = JWT ::decode ($ encoded , 'my_key ' , array ('HS256 ' ));
86
86
$ this ->assertEquals ($ decoded ->message , 'abc ' );
87
+ JWT ::$ leeway = 0 ;
87
88
}
88
89
89
90
public function testExpiredTokenWithLeeway ()
@@ -96,6 +97,7 @@ public function testExpiredTokenWithLeeway()
96
97
$ encoded = JWT ::encode ($ payload , 'my_key ' );
97
98
$ decoded = JWT ::decode ($ encoded , 'my_key ' , array ('HS256 ' ));
98
99
$ this ->assertEquals ($ decoded ->message , 'abc ' );
100
+ JWT ::$ leeway = 0 ;
99
101
}
100
102
101
103
public function testValidTokenWithList ()
@@ -129,6 +131,7 @@ public function testValidTokenWithNbfLeeway()
129
131
$ encoded = JWT ::encode ($ payload , 'my_key ' );
130
132
$ decoded = JWT ::decode ($ encoded , 'my_key ' , array ('HS256 ' ));
131
133
$ this ->assertEquals ($ decoded ->message , 'abc ' );
134
+ JWT ::$ leeway = 0 ;
132
135
}
133
136
134
137
public function testInvalidTokenWithNbfLeeway ()
@@ -140,6 +143,7 @@ public function testInvalidTokenWithNbfLeeway()
140
143
$ encoded = JWT ::encode ($ payload , 'my_key ' );
141
144
$ this ->setExpectedException ('BeforeValidException ' );
142
145
$ decoded = JWT ::decode ($ encoded , 'my_key ' , array ('HS256 ' ));
146
+ JWT ::$ leeway = 0 ;
143
147
}
144
148
145
149
public function testValidTokenWithIatLeeway ()
@@ -151,6 +155,7 @@ public function testValidTokenWithIatLeeway()
151
155
$ encoded = JWT ::encode ($ payload , 'my_key ' );
152
156
$ decoded = JWT ::decode ($ encoded , 'my_key ' , array ('HS256 ' ));
153
157
$ this ->assertEquals ($ decoded ->message , 'abc ' );
158
+ JWT ::$ leeway = 0 ;
154
159
}
155
160
156
161
public function testInvalidTokenWithIatLeeway ()
@@ -162,6 +167,7 @@ public function testInvalidTokenWithIatLeeway()
162
167
$ encoded = JWT ::encode ($ payload , 'my_key ' );
163
168
$ this ->setExpectedException ('BeforeValidException ' );
164
169
$ decoded = JWT ::decode ($ encoded , 'my_key ' , array ('HS256 ' ));
170
+ JWT ::$ leeway = 0 ;
165
171
}
166
172
167
173
public function testInvalidToken ()
0 commit comments