You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per sebastianbergmann/phpunit#3687, the PHPUnit\Framework\MockObject\MockBuilder::setMethods() method was deprecated (soft in PHPUnit 8, hard in PHPUnit 9) and scheduled for removal in PHPUnit 10. It was being replaced by onlyMethods() and addMethods().
In my WordPress plugin codebase, I'm using PHPUnit from 7-9, but whereas various assertions from PHPUnit 9 are polyfilled, the onlyMethods method is not (I'm not using addMethods()).
@GaryJones I'll have a think about this, but polyfilling anything for MockBuilder would not be as straight forward as polyfilling assertions/expectations/constraint, where each of the polyfills can be used as a trait as all test classes have to extend from the PHPUnit native TestCase anyway (or for convenience via the provided TestCases).
The only way I can currently imagine doing that would be by providing a MockBuilder class in this library, which would mean that the class would have to be switched out in any test suite which would want to use the Polyfilled methods. Not sure I want to go down that road.
As per sebastianbergmann/phpunit#3687, the
PHPUnit\Framework\MockObject\MockBuilder::setMethods()
method was deprecated (soft in PHPUnit 8, hard in PHPUnit 9) and scheduled for removal in PHPUnit 10. It was being replaced byonlyMethods()
andaddMethods()
.In my WordPress plugin codebase, I'm using PHPUnit from 7-9, but whereas various assertions from PHPUnit 9 are polyfilled, the
onlyMethods
method is not (I'm not usingaddMethods()
).See https://github.com/Parsely/wp-parsely/runs/3754851373?check_suite_focus=true for a CI run that failed on PHP 7.1 when the test code used
onlyMethods()
. PHP 7.2 (PHPUnit 8) and above passed fine.Can these new methods please be polyfilled for earlier versions of PHPUnit?
The text was updated successfully, but these errors were encountered: