summaryrefslogtreecommitdiffstats
path: root/tests/JWTTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/JWTTest.php')
-rw-r--r--tests/JWTTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/JWTTest.php b/tests/JWTTest.php
index da9975c..b1fc1eb 100644
--- a/tests/JWTTest.php
+++ b/tests/JWTTest.php
@@ -194,6 +194,14 @@ class JWTTest extends PHPUnit_Framework_TestCase
$this->assertEquals($decoded, 'abc');
}
+ public function testArrayAccessKIDChooser()
+ {
+ $keys = new ArrayObject(array('1' => 'my_key', '2' => 'my_key2'));
+ $msg = JWT::encode('abc', $keys['1'], 'HS256', '1');
+ $decoded = JWT::decode($msg, $keys, array('HS256'));
+ $this->assertEquals($decoded, 'abc');
+ }
+
public function testNoneAlgorithm()
{
$msg = JWT::encode('abc', 'my_key');