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

Replace getMock calls with getMockBuilder()->getMock() calls in tests #497

Merged
merged 1 commit into from
Jun 30, 2016

Conversation

hairmare
Copy link
Contributor

The upgrade to PHPUnit 5.4 wants us to use createMock instead of getMock as per the PHPUnit 5.4 Releasenotes.

This PR changes the tests so they execute properly using the latest PHPUnit.

@xabbuh
Copy link
Contributor

xabbuh commented Jun 13, 2016

As you can see in the Travis build this fails on older PHPUnit versions. If you want to avoid the deprecated getMock() method here, I suggest to use getMockBuilder() instead which is available on those versions too.

@hairmare
Copy link
Contributor Author

Thanks @xabbuh I just noticed myself and will update the PR so it still works with older phpunit versions.

@hairmare hairmare changed the title Replace getMock calls with createMock calls in tests Replace getMock calls with getMockBuilder()->getMock() calls in calls in tests Jun 13, 2016
@hairmare hairmare changed the title Replace getMock calls with getMockBuilder()->getMock() calls in calls in tests Replace getMock calls with getMockBuilder()->getMock() calls in tests Jun 13, 2016
@hairmare
Copy link
Contributor Author

I updated this PR so it works with PHPUnit <5 as well as PHPUnit >= 5.4.

@narcoticfresh
Copy link

@xabbuh can this be merged?

@xabbuh
Copy link
Contributor

xabbuh commented Jun 29, 2016

@narcoticfresh Sorry, I am not a maintainer of this bundle. But the changes so far look good to me.

@fabpot
Copy link
Member

fabpot commented Jun 30, 2016

@hairmare Looks good to me as well. Small nitpicking: can you move the whole expression on one line for each call?

The upgrade to PHPUnit 5.4 wants us to use `getMockBuilder()->getMock()` instead of `getMock()` as per https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.4.0#changes. This PR changes the tests so they execute properly using the latest PHPUnit again.
@hairmare
Copy link
Contributor Author

@fabpot I addressed the formatting changes and rebased the pull request. Thanks

@fabpot
Copy link
Member

fabpot commented Jun 30, 2016

Thank you @hairmare.

@fabpot fabpot merged commit 969ca07 into sensiolabs:master Jun 30, 2016
fabpot added a commit that referenced this pull request Jun 30, 2016
…ls in tests (hairmare)

This PR was merged into the 3.0.x-dev branch.

Discussion
----------

Replace getMock calls with getMockBuilder()->getMock() calls in tests

The upgrade to PHPUnit 5.4 wants us to use `createMock` instead of `getMock` as per [the PHPUnit 5.4 Releasenotes](https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-5.4.0#changes).

This PR changes the tests so they execute properly using the latest PHPUnit.

Commits
-------

969ca07 Replace getMock calls with getMockBuilder()->getMock() calls in tests
@hairmare hairmare deleted the feature/phpunit-bumpage branch June 30, 2016 08:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants