Skip to content

Avoid latest version of phpunit mock object #2476

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

Closed

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented Aug 22, 2016

That way, people can still work on their PR until the build is fixed.

Workaround for #2475 (not a proper fix)

That way, people can still work on their PR until the build is fixed.
@Ocramius
Copy link
Member

What is the issue leading to this? createMock?

@greg0ire
Copy link
Member Author

Not sure yet… in Sonata we use getMock, and have this problem too.

@Ocramius
Copy link
Member

getMock will not work with PHPUnit 5.4+ (deprecation errors all over the place). The solution is to replace the calls with createMock calls

@greg0ire
Copy link
Member Author

getMock will not work with PHPUnit 5.4+ (deprecation errors all over the place). The solution is to replace the calls with createMock calls

I think it is a different issues : these are php warnings, not phpunit warnings.

@greg0ire
Copy link
Member Author

In Sonata it came from the fact we did not use getMock properly (not using FQCN, misspelling stdClass)

@greg0ire
Copy link
Member Author

greg0ire commented Aug 22, 2016

not using FQCN

Which seems to be the problem too in the case of this lib, see https://github.com/doctrine/dbal/blob/master/tests/Doctrine/Tests/DBAL/ConnectionTest.php#L105 , for instance.

Related issue : sebastianbergmann/phpunit-mock-objects#321

@Ocramius
Copy link
Member

Then let's fix the test rather than blocking the dep (which will lead to more issues down the line)

@greg0ire
Copy link
Member Author

I don't have the time right now, that's why I'm suggesting this temporary workaround, but sure, the tests (plural, that's why I think it will be long) have to be fixed properly and the commit in this PR reverted. Meanwhile, having green builds will allow other contributions to be merged (like #2473 , which I wrote this morning).

@greg0ire
Copy link
Member Author

I can commit to fix it properly one evening this week though.

@Ocramius
Copy link
Member

Closing here meanwhile then. Sorry, workarounds are not something that I will merge, unless we are really cornered inside a tight solution space.

@Ocramius
Copy link
Member

@greg0ire thanks if you can submit further patches though!

@greg0ire
Copy link
Member Author

No problem, I understand. I should be able to fix that properly tomorrow night

@greg0ire greg0ire deleted the workaround_until_build_fixed branch August 22, 2016 14:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants