Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Upgrade to PHP 5.6 and PHPUnit 5.7/6.0 #114

Merged

Conversation

weierophinney
Copy link
Member

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.

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.
@weierophinney weierophinney added this to the 2.9.0 milestone Mar 20, 2017
- 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 weierophinney merged commit 5cbfaea into zendframework:develop Mar 20, 2017
weierophinney added a commit that referenced this pull request Mar 20, 2017
weierophinney added a commit that referenced this pull request Mar 20, 2017
@weierophinney weierophinney deleted the hotfix/phpunit-upgrade branch March 20, 2017 21:59
@@ -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();
Copy link
Contributor

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
Copy link
Contributor

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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants