This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Upgrade to PHP 5.6 and PHPUnit 5.7/6.0 #114
Merged
weierophinney
merged 5 commits into
zendframework:develop
from
weierophinney:hotfix/phpunit-upgrade
Mar 20, 2017
Merged
Upgrade to PHP 5.6 and PHPUnit 5.7/6.0 #114
weierophinney
merged 5 commits into
zendframework:develop
from
weierophinney:hotfix/phpunit-upgrade
Mar 20, 2017
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This patch updates the package to: - Set the minimum supported PHP version to 5.6. - Set the supported PHPUnit version to either 5.7 or 6.0, depending on PHP version used. A number of test changes were required: - All references to `PHPUnit_Framework_TestCase` were updated to the namespaced version. In any case where the class was not imported, an import statement was created. - All `setExpectedException()` calls were updated to `expectException()`, and, if an expected message was provided, `expectExceptionMessage()` - A number of `getMock()` calls still existed without usage of `getMockBuilder()`; these were updated. - A zend-servicemanager test trait for testing container compatibility between zend-servicemanager versions differs from v2 to v3; the two instances in this particular suite were updated to override the necessary tests to vary strategy based on which PHP version was detected. - New test failures were discovered in the flash messenger tests due to differences in how PHPUnit handles global state; these were corrected.
- Remove 5.5 targets - Added "legacy deps" definition, and installation of these when using PHP 5.6 - Move coverage deps to an env variable
5.7.0 had a bug with how it matched data providers to the methods utilizing them, particularly when traits were involved. Bumping the miniumum version fixes the issue.
weierophinney
added a commit
that referenced
this pull request
Mar 20, 2017
weierophinney
added a commit
that referenced
this pull request
Mar 20, 2017
kokspflanze
reviewed
Mar 20, 2017
@@ -30,7 +30,7 @@ public function setUp() | |||
|
|||
public function testViewSettersGetters() | |||
{ | |||
$viewMock = $this->getMock('Zend\View\Renderer\RendererInterface'); | |||
$viewMock = $this->getMockBuilder('Zend\View\Renderer\RendererInterface')->getMock(); |
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.
createMock
would be easyer, than getMockBuilder
@@ -17,7 +17,7 @@ | |||
* @group Zend_View | |||
* @group Zend_View_Helper | |||
*/ | |||
class CycleTest extends \PHPUnit_Framework_TestCase | |||
class CycleTest extends \PHPUnit\Framework\TestCase |
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.
maybe add that directly in the use
section
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch updates the package to:
A number of test changes were required:
PHPUnit_Framework_TestCase
were updated to the namespaced version. In any case where the class was not imported, an import statement was created.setExpectedException()
calls were updated toexpectException()
, and, if an expected message was provided,expectExceptionMessage()
getMock()
calls still existed without usage ofgetMockBuilder()
; these were updated.