Skip to content

Commit

Permalink
PHPUnit 9 support (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
remorhaz committed Feb 14, 2020
1 parent 840959c commit bc4c6fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ build
composer.lock
phpunit.xml
vendor
.phpunit.result.cache
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
"irc": "irc://irc.freenode.org/amphp"
},
"require": {
"phpunit/phpunit": "^6 | ^7 | ^8"
"phpunit/phpunit": "^6 | ^7 | ^8 | ^9"
},
"require-dev": {
"amphp/amp": "^2",
Expand Down
9 changes: 8 additions & 1 deletion test/AsyncTestCaseTest.php
Expand Up @@ -132,7 +132,14 @@ public function testSetMinimumRunTime(): \Generator
};

$this->expectException(AssertionFailedError::class);
$this->expectExceptionMessageRegExp("/Expected test to take at least 100ms but instead took (\d+)ms/");
$pattern = "/Expected test to take at least 100ms but instead took (\d+)ms/";
if (\method_exists($this, 'expectExceptionMessageMatches')) {
// PHPUnit 8+
$this->expectExceptionMessageMatches($pattern);
} else {
// PHPUnit 6-7
$this->expectExceptionMessageRegExp($pattern);
}
yield call($func);
}

Expand Down

0 comments on commit bc4c6fd

Please sign in to comment.