Skip to content

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

Merged
clue merged 3 commits into
masterfrom
unknown repository
Jan 11, 2017
Merged

Avoid deprecation warnings in test suite due to deprecation of getMock() in PHPUnit#68
clue merged 3 commits into
masterfrom
unknown repository

Conversation

@ghost

Copy link
Copy Markdown

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

jsor commented Jan 11, 2017

Copy link
Copy Markdown
Member

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
Copy Markdown
Author

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

@jsor

jsor commented Jan 11, 2017

Copy link
Copy Markdown
Member

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.

@clueclue changed the title Avoid warnings due to deprecation of getMock() in PHPUnitAvoid deprecation warnings in test suite due to deprecation of getMock() in PHPUnitJan 11, 2017

@clueclue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@clue
clue merged commit c3653ae into reactphp:masterJan 11, 2017
@ghost
ghost deleted the mocking branch January 11, 2017 14:09
@clueclue added this to the v0.4.3 milestone Jan 16, 2017
@jsorjsor mentioned this pull request Feb 6, 2017
Sign up for freeto 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

@jsor@WyriHaximus@clue@kooldev