Skip to content

Commit c595e2b

Browse files
author
Aztech
committed
Add tests for \ArrayAccess key chooser
1 parent d089a3a commit c595e2b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/JWTTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ public function testKIDChooser()
194194
$this->assertEquals($decoded, 'abc');
195195
}
196196

197+
public function testArrayAccessKIDChooser()
198+
{
199+
$keys = new ArrayObject(array('1' => 'my_key', '2' => 'my_key2'));
200+
$msg = JWT::encode('abc', $keys['1'], 'HS256', '1');
201+
$decoded = JWT::decode($msg, $keys, array('HS256'));
202+
$this->assertEquals($decoded, 'abc');
203+
}
204+
197205
public function testNoneAlgorithm()
198206
{
199207
$msg = JWT::encode('abc', 'my_key');

0 commit comments

Comments
 (0)