Skip to content

Commit efc04f9

Browse files
committed
Allow composer to choose the latest phpunit major version matching each PHP version
1 parent 5cd7ae0 commit efc04f9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
}
2929
},
3030
"require-dev": {
31-
"phpunit/phpunit": "^4.8|^5"
31+
"phpunit/phpunit": ">=4.8 <=9"
3232
}
3333
}

tests/JWTTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ class JWTTest extends TestCase
88
{
99
public static $opensslVerifyReturnValue;
1010

11+
/*
12+
* For compatibility with PHPUnit 4.8 and PHP < 5.6
13+
*/
14+
public function setExpectedException($exceptionName, $message = '', $code = NULL) {
15+
if (method_exists($this, 'expectException')) {
16+
$this->expectException($exceptionName);
17+
} else {
18+
parent::setExpectedException($exceptionName, $message, $code);
19+
}
20+
}
21+
1122
public function testEncodeDecode()
1223
{
1324
$msg = JWT::encode('abc', 'my_key');

0 commit comments

Comments
 (0)