Skip to content

Allow composer to choose the latest phpunit major version matching each PHP version #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5"
"phpunit/phpunit": ">=4.8 <=9"
}
}
11 changes: 11 additions & 0 deletions tests/JWTTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down