summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/JWTTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/JWTTest.php b/tests/JWTTest.php
index 1ace7f5..cc2eb8c 100644
--- a/tests/JWTTest.php
+++ b/tests/JWTTest.php
@@ -116,4 +116,18 @@ class JWTTest extends PHPUnit_Framework_TestCase
$decoded = JWT::decode($msg, $keys, array('HS256'));
$this->assertEquals($decoded, 'abc');
}
+
+ public function testNoneToken()
+ {
+ $msg = JWT::encode('abc', 'my_key');
+ $this->setExpectedException('DomainException');
+ JWT::decode($msg, 'my_key', array('none'));
+ }
+
+ public function testIncorrectAlgorithm()
+ {
+ $msg = JWT::encode('abc', 'my_key');
+ $this->setExpectedException('DomainException');
+ JWT::decode($msg, 'my_key', array('RS256'));
+ }
}