Skip to content

Avoid deprecation warnings in test suite due to deprecation of getMock() in PHPUnit #68

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

Merged
merged 3 commits into from Jan 11, 2017
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 11, 2017

The method getMock() was deprecated with the release of PHPUnit 5.4. The same release introduced createMock() that should be used to create mock objects instead. This PR modifies React\Tests\EventLoop\TestCase::createCallableMock() to use the new mock API if available.

@jsor
Copy link
Member

jsor commented Jan 11, 2017

We've currently decided to add PHPUnit 4.8 to require-dev of each component, see reactphp/reactphp#354. This will fix this issue.

As a side note: i've also fixed this latetly in react/promise by using

$this
    ->getMockBuilder('React\Promise\Stub\CallableStub')
    ->getMock();

This works in all version of PHPUnit, see reactphp/promise@73f2304#diff-d4c8c6dc8769324fc27cfdac19f05caf

@ghost
Copy link
Author

ghost commented Jan 11, 2017

Should i change the PR to use mock builder or close it and let you introduce PHPUnit 4.8 instead?

@jsor
Copy link
Member

jsor commented Jan 11, 2017

I'd vote for getting this in for forward compatibility and to avoid warnings when users run the tests not from vendors but with their local version of PHPUnit.

@clue clue changed the title Avoid warnings due to deprecation of getMock() in PHPUnit Avoid deprecation warnings in test suite due to deprecation of getMock() in PHPUnit Jan 11, 2017
Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @martinschroeder and @jsor!

@clue clue merged commit c3653ae into reactphp:master Jan 11, 2017
@ghost ghost deleted the mocking branch January 11, 2017 14:09
@clue clue added this to the v0.4.3 milestone Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy