Skip to content

Commit bc4c6fd

Browse files
authored
PHPUnit 9 support (#11)
1 parent 840959c commit bc4c6fd

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build
33
composer.lock
44
phpunit.xml
55
vendor
6+
.phpunit.result.cache

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"irc": "irc://irc.freenode.org/amphp"
1919
},
2020
"require": {
21-
"phpunit/phpunit": "^6 | ^7 | ^8"
21+
"phpunit/phpunit": "^6 | ^7 | ^8 | ^9"
2222
},
2323
"require-dev": {
2424
"amphp/amp": "^2",

test/AsyncTestCaseTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,14 @@ public function testSetMinimumRunTime(): \Generator
132132
};
133133

134134
$this->expectException(AssertionFailedError::class);
135-
$this->expectExceptionMessageRegExp("/Expected test to take at least 100ms but instead took (\d+)ms/");
135+
$pattern = "/Expected test to take at least 100ms but instead took (\d+)ms/";
136+
if (\method_exists($this, 'expectExceptionMessageMatches')) {
137+
// PHPUnit 8+
138+
$this->expectExceptionMessageMatches($pattern);
139+
} else {
140+
// PHPUnit 6-7
141+
$this->expectExceptionMessageRegExp($pattern);
142+
}
136143
yield call($func);
137144
}
138145

0 commit comments

Comments
 (0)