We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Methods and functions with return type declaration void or never can not be mocked to throw an Exception:
void
never
class Example { public function store(string $something): void { ... } } $mock = NewInstance::of(Example::class) $mock->returns(['store' => throws(new Exception('failure'))]);
InvalidArgumentException: Trying to map method Example::store(), but it is declared as returning void or never.
It should be possible to throw an exception from such a method, while providing a regular return value should still be forbidden.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Methods and functions with return type declaration
void
ornever
can not be mocked to throw an Exception:InvalidArgumentException: Trying to map method Example::store(), but it is declared as returning void or never.
It should be possible to throw an exception from such a method, while providing a regular return value should still be forbidden.
The text was updated successfully, but these errors were encountered: