-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Forward compatibility with PHPUnit 5 and PHPUnit 6 #86
Conversation
Thank you for this PR! 👍 The |
@clue Sure. I'll change this calls and amend this PR ASAP. |
tests/Io/SenderTest.php
Outdated
@@ -106,28 +112,28 @@ public function provideRequestProtocolVersion() | |||
*/ | |||
public function testRequestProtocolVersion(Request $Request, $method, $uri, $headers, $protocolVersion) | |||
{ | |||
$http = $this->getMock( | |||
$http = $this->getMockBuilder( |
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.
@clue What should we do here? createPartialMock
does not work for PHPUnit 4
.
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.
Not sure I follow, can you elaborate what the issue is? The getMock()
method does in fact work just fine with PHPUnit 4 or am I missing something?
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.
If I substitute getMock()
to getMockBuilder()->getMock()
for PHPUnit 5 and 6 compatibility, is didn't work. But, there's this createParticalMock()
that solves this issue, buts it doesn't existis in PHPUnit 4
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.
Interesting! How about adding a check à la if(phpunit 4) { dothis(); } else { dothat(); }
here?
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.
@clue I'll find a better way, or, we'll need to decide what versions to support.
@clue Done, I've found every method support in all versions. |
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.
Thanks for keeping up with this, changes LGTM! 👍
I've added
PHPUnit 5
support. Also, prepare forPHPUnit 6
. I did not support version 6 already becausegetMock
method was removed from it, butcreateMock
isn't available in version 4. So we will need to decide:Migrate to PHPUnit 6, drop version 4 support, as well
PHP 5.6
will become the minimum requirement or stay as we are, or stay where we are.