Skip to content

Commit c612b99

Browse files
author
drtriumph
committed
A few additional tests for none algorithm and an incorrect algorithm
1 parent b2c2be6 commit c612b99

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/JWTTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,18 @@ public function testKIDChooser()
116116
$decoded = JWT::decode($msg, $keys, array('HS256'));
117117
$this->assertEquals($decoded, 'abc');
118118
}
119+
120+
public function testNoneToken()
121+
{
122+
$msg = JWT::encode('abc', 'my_key');
123+
$this->setExpectedException('DomainException');
124+
JWT::decode($msg, 'my_key', array('none'));
125+
}
126+
127+
public function testIncorrectAlgorithm()
128+
{
129+
$msg = JWT::encode('abc', 'my_key');
130+
$this->setExpectedException('DomainException');
131+
JWT::decode($msg, 'my_key', array('RS256'));
132+
}
119133
}

0 commit comments

Comments
 (0)