-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Throw exception on non unique mocked method #4258
Throw exception on non unique mocked method #4258
Conversation
1ce8bfb
to
d4b906b
Compare
Codecov Report
@@ Coverage Diff @@
## master #4258 +/- ##
============================================
- Coverage 84.26% 84.22% -0.05%
- Complexity 4526 4527 +1
============================================
Files 218 218
Lines 11101 11103 +2
============================================
- Hits 9354 9351 -3
- Misses 1747 1752 +5
Continue to review full report at Codecov.
|
This patch will make a mock throw an exception when multiple matchers can be applied to a invoke. When allowing this, results of tests are not predictable. refs sebastianbergmann#4255
d4b906b
to
e860ff4
Compare
Cherry-picked into |
This change broke |
|
No worries about the above. We fixed the test which probably was incorrect to begin with. Thanks for your work! |
This was definitely a broken test. The mocked method in question was called to many times internally. Although phpunit didn't report this. |
This patch will make a mock throw an exception when multiple matchers
can be applied to a invoke. When allowing this, the results of tests are
not predictable.
In preparation on #4255 I found that a test case like the one below would never pass. Because the written test is just wrong. However, the mocking framework does allow this. But does not handle it properly. From now on an exception will be thrown.
refs #4255