-
Notifications
You must be signed in to change notification settings - Fork 61
Make sure latest version works on both PHP 5.6 and 7 #42
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
Conversation
|
@lstrojny this PR fixes tests allowing the latest version of the library to run on both PHP 7 and 5.6. |
|
I would prefer not to go back to PHPUnit 5 but instead have a test suite that works with both 5 and 6, which should be relatively trivial. That way we can have both: 5.6 compatibility on the one hand but support for PHPUnit 6 as well. |
This reverts commit 05d95cf.
|
The problem is that PHPUnit 6 requires PHP 7, so we don't have much choice if we want to support both 5.6 and 7 at the same time than to rollback to PHPUnit 5. |
|
@ademarco what about requiring "5|6" and having a tiny compatibility layer? |
|
Yep, that can be interesting, I'll try that! |
|
There we go! \cc @lstrojny |
| $this->assertSame('post-value', $this->http['firstNamedServer']->requests->latest()->getPostField('post-key')); | ||
| } | ||
|
|
||
| public function testFatalError() |
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.
We can have this test back for PHP 7, can’t we?
| $this->tearDown(); | ||
| $this->fail('Exception expected'); | ||
| } catch (ExpectationFailedException $e) { | ||
| } catch (\PHPUnit_Framework_ExpectationFailedException $e) { |
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.
This exception class is not available in PHPUnit 6, is it?
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.
Yep, that's correct, but there isn't a compatibility layer on PHPUnit 5.7 for that, so the only option is to fall back to \Exception.
It turned out that we were running on phpunit 5.7 also on php7 due to the phpmock object dependencies, I'll fix that making sure to offer a compatible alternative for that too.
| ); | ||
| } | ||
|
|
||
| public function testFatalError() |
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.
Same here, since it checks for 7.0, it should work fine
|
@lstrojny Ok tests are back and now we use phpunit 6 on php 7 and phpunit 5.7 on php 5.6. |
|
Thank you! |
|
Great, thanks! |
This is a test PR to assess if PHP 7 is actually a required dependency or if the project can work on PHP 5.6 too.