Skip to content

Commit f42c911

Browse files
authored
fix: add missing use statement in JWK (#303)
1 parent 1fae8c4 commit f42c911

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/JWK.php

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Firebase\JWT;
44

55
use DomainException;
6+
use InvalidArgumentException;
67
use UnexpectedValueException;
78

89
/**

tests/JWKTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ public function testParseJwkKeySet()
4343
self::$keys = $keys;
4444
}
4545

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+
4660
/**
4761
* @depends testParseJwkKeySet
4862
*/

0 commit comments

Comments
 (0)