-
Notifications
You must be signed in to change notification settings - Fork 461
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
Add support for PHPUnit version 9 #1053
Conversation
$this->assertArrayNotHasKey(\Mockery::class, \PHPUnit\Util\Blacklist::$blacklistedClassNames); | ||
$this->listener->startTestSuite($suite); | ||
$this->assertSame(1, \PHPUnit\Util\Blacklist::$blacklistedClassNames[\Mockery::class]); | ||
if (method_exists(\PHPUnit\Util\Blacklist::class, 'addDirectory')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it would be better to split this up into two tests and skip one of them depending on PHPUnit version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davedevelopment I can't find an easy way to check the minimum required version of PHPUnit is 9.1.3
, so maybe we can leave this as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this
@@ -37,4 +37,22 @@ protected function mockeryTestSetUp() | |||
protected function mockeryTestTearDown() | |||
{ | |||
} | |||
|
|||
public function expectExceptionMessageRegEx($regularExpression) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it have been better to leave the method name as expectExceptionMessageRegExp
here? Or was there a clash in the signatures over the course of different PHPUnit versions?
The travis build is failing because there are still some tests in there call expectExceptionMessageRegExp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I did here https://github.com/mockery/mockery/pull/1049/files#diff-491577b1fec453820a42849002bd0828R41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davedevelopment Yes there are issues with signatures. I'll try to fix travis build so it passes.
$this->assertArrayNotHasKey(\Mockery::class, \PHPUnit\Util\Blacklist::$blacklistedClassNames); | ||
$this->listener->startTestSuite($suite); | ||
$this->assertSame(1, \PHPUnit\Util\Blacklist::$blacklistedClassNames[\Mockery::class]); | ||
if (method_exists(\PHPUnit\Util\Blacklist::class, 'addDirectory')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree 👍
* master: Revert expectExceptionMessageMatches() Fix DocBlocks for variadic arguments Start 1.3.2 changelog. Tweak test name for specificity. Fix bug in anyOtherArguments matching logic. Fix indentation in new test to match existing indentation. Add new failing test and fix error in test causing false success. Update usages of deprecated PHPUnit expectation. Update installation.rst
* master: Update type hints to be more specific Fix type hint on shouldNotRecieve() argument Slim down mockery when loaded as a dependency
@davedevelopment the build is now green, could you please take a look at this again? I would love to see this released as it currently prevents people from upgrading to PHPUnit version above 9.1.2. |
@martinssipenko I was just about to pull this branch and finish it myself! Will review now. |
Merged. I'm going to take a look at dropping our list of supported PHP and PHPUnit versions today and will probably make a release later. |
Sweet, yeah the list of supported PHP version is quite long and is starting to cause much pain. |
PR created #1059 One thing I'm going to revert from this, those helpers for the regExp methods should be on a test case specifically for the mockery tests, rather than the |
Maybe they are not needed at all if support for older version, where they were not present or were named differently, is dropped. |
This adds support for PHPUnit version 9.
PHPUnit version 9.1.2 had a breaking change in then
@internal
markedBlacklist
class, which was addressed in 9.1.3.Fixes #1048