File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 3
3
namespace Firebase \JWT ;
4
4
5
5
use DomainException ;
6
+ use InvalidArgumentException ;
6
7
use UnexpectedValueException ;
7
8
8
9
/**
Original file line number Diff line number Diff line change 2
2
3
3
namespace Firebase \JWT ;
4
4
5
- use \ DomainException ;
6
- use \ InvalidArgumentException ;
7
- use \ UnexpectedValueException ;
8
- use \ DateTime ;
5
+ use DomainException ;
6
+ use InvalidArgumentException ;
7
+ use UnexpectedValueException ;
8
+ use DateTime ;
9
9
10
10
/**
11
11
* JSON Web Token implementation, based on this spec:
@@ -62,6 +62,7 @@ class JWT
62
62
*
63
63
* @return object The JWT's payload as a PHP object
64
64
*
65
+ * @throws InvalidArgumentException Provided JWT was empty
65
66
* @throws UnexpectedValueException Provided JWT was invalid
66
67
* @throws SignatureInvalidException Provided JWT was invalid because the signature verification failed
67
68
* @throws BeforeValidException Provided JWT is trying to be used before it's eligible as defined by 'nbf'
Original file line number Diff line number Diff line change @@ -43,6 +43,20 @@ public function testParseJwkKeySet()
43
43
self ::$ keys = $ keys ;
44
44
}
45
45
46
+ public function testParseJwkKey_empty ()
47
+ {
48
+ $ this ->setExpectedException ('InvalidArgumentException ' , 'JWK must not be empty ' );
49
+
50
+ JWK ::parseKeySet (array ('keys ' => array (array ())));
51
+ }
52
+
53
+ public function testParseJwkKeySet_empty ()
54
+ {
55
+ $ this ->setExpectedException ('InvalidArgumentException ' , 'JWK Set did not contain any keys ' );
56
+
57
+ JWK ::parseKeySet (array ('keys ' => array ()));
58
+ }
59
+
46
60
/**
47
61
* @depends testParseJwkKeySet
48
62
*/
You can’t perform that action at this time.
0 commit comments