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
atMost(...)
When using the atMost(...) invocation rule, and the UUT does not invoke the mocked function, then I get the following error:
Expectation failed for method name is "mockedMethodName" when invoked at most 1 times. Mocked method does not exist.
Test fails with error, when mocked method never called with atMost(...) invocation rule.
atMost(1)
My example call:
$this->storesRepository->expects(self::atMost(1)) ->method('findOneBy') ->with(['name' => $storeName]) ->willReturn($storeEntityWithSameName);
Test passes as zero calls is smaller then the value passed to the atMost(...) invocation rule.
The text was updated successfully, but these errors were encountered:
Fix atMost(...) invocation rule throws error on zero invocation
50ffe68
Closes #4950
No branches or pull requests
Summary
When using the
atMost(...)
invocation rule, and the UUT does not invoke the mocked function, then I get the following error:Current behavior
Test fails with error, when mocked method never called with
atMost(...)
invocation rule.How to reproduce
atMost(1)
for example, but do not call the mocked method from the tested unit.My example call:
Expected behavior
Test passes as zero calls is smaller then the value passed to the
atMost(...)
invocation rule.The text was updated successfully, but these errors were encountered: