diff --git a/composer.json b/composer.json index e72ecd07..25d1cfa9 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,6 @@ } }, "require-dev": { - "phpunit/phpunit": "^4.8|^5" + "phpunit/phpunit": ">=4.8 <=9" } } diff --git a/tests/JWTTest.php b/tests/JWTTest.php index 0e1c20d1..19520165 100644 --- a/tests/JWTTest.php +++ b/tests/JWTTest.php @@ -8,6 +8,17 @@ class JWTTest extends TestCase { public static $opensslVerifyReturnValue; + /* + * For compatibility with PHPUnit 4.8 and PHP < 5.6 + */ + public function setExpectedException($exceptionName, $message = '', $code = NULL) { + if (method_exists($this, 'expectException')) { + $this->expectException($exceptionName); + } else { + parent::setExpectedException($exceptionName, $message, $code); + } + } + public function testEncodeDecode() { $msg = JWT::encode('abc', 'my_key');