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
getMockBuilder() will be soft-deprecated (@deprecated annotation) in PHPUnit 10.1, deprecated (triggering a deprecation warning) in PHPUnit 11, and removed in PHPUnit 12. Therefore no changes should be made to it anymore.
Since #3687
setMethods
is deprecated in favor ofonlyMethods
andaddMethods
It was possible to do this
but with
An exception is thrown
PHPUnit\Framework\MockObject\ReflectionException: Class UnknownClass does not exist
.So is not possible to mock unknown types.
A possibility is to check
allowMockingUnknownTypes
in mockBuilder and if is true not thrown exception (as suggested here #3687 (comment))What do you think ? Or how can I mock methods on unknown type ? (if you are ok, I can make a PR)
The text was updated successfully, but these errors were encountered: