-
Notifications
You must be signed in to change notification settings - Fork 242
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
Support for mocking methods with "static" return type #620
Comments
The error message does not say that mocking such methods is not supported. It says that guessing a return value is not supported and you need to configure an explicit one (for instance by using |
That helped. Thanks. What about the associated PR ( #621 ) to improve guessing code? |
I'm getting an error, that $mock = $this->prophesize('Process');
$mock->mustRun()->willReturn($mock)->shouldBeCalled(); is this correct way or I should be doing $mock = $this->prophesize('Process');
$mock->mustRun()->willReturn($mock->reveal())->shouldBeCalled(); instead? |
ah indeed. We don't have The first code snippet is fine. |
Great. Closing. |
When attempting to mock a method with a
static
return type (see https://php.watch/versions/8.0/static-return-type), then you'll get this error:Code:
The text was updated successfully, but these errors were encountered: