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
Prevent shouldNotReceive
from getting overridden by invocation count methods
#1329
Merged
ghostwriter
merged 4 commits into
1.6.x
from
issue-1328/shouldnotreceive-is-overridden-by-invocation-count-methods
Aug 23, 2023
Merged
Prevent shouldNotReceive
from getting overridden by invocation count methods
#1329
ghostwriter
merged 4 commits into
1.6.x
from
issue-1328/shouldnotreceive-is-overridden-by-invocation-count-methods
Aug 23, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com> Co-Authored-By: Danny-Smart <113538899+Danny-Smart@users.noreply.github.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
ghostwriter
added
Bug
An error or unexpected behavior.
Patch
Backwards compatible bug fixes and improvements
Fixed
for bug fixes or error corrections
labels
Aug 14, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 1.6.x #1329 +/- ##
============================================
+ Coverage 77.66% 77.70% +0.04%
- Complexity 1016 1018 +2
============================================
Files 76 76
Lines 2601 2606 +5
============================================
+ Hits 2020 2025 +5
Misses 581 581
|
ghostwriter
force-pushed
the
issue-1328/shouldnotreceive-is-overridden-by-invocation-count-methods
branch
from
August 15, 2023 01:08
ca01d13
to
e181f30
Compare
ghostwriter
added
Patch
Backwards compatible bug fixes and improvements
deprecation
something is or will be deprecated
Deprecated
for features or functionality that will be removed in a future release
and removed
deprecation
something is or will be deprecated
labels
Aug 15, 2023
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
ghostwriter
force-pushed
the
issue-1328/shouldnotreceive-is-overridden-by-invocation-count-methods
branch
from
August 15, 2023 02:34
e181f30
to
fe754a2
Compare
I left this pull request open but received no response for discussion, again. I will merge it now, but welcome any feedback post-merge. Thanks! |
ghostwriter
deleted the
issue-1328/shouldnotreceive-is-overridden-by-invocation-count-methods
branch
August 23, 2023 09:14
No news is good news 😄 I found no fault when I checked this before |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
An error or unexpected behavior.
Deprecated
for features or functionality that will be removed in a future release
Fixed
for bug fixes or error corrections
Patch
Backwards compatible bug fixes and improvements
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1328
Currently, to indicate that an expectation is
never
expected to be called, Mockery internally sets the invocation count to0
usingMocker\Expectation::never()
which is equivalent totimes(0)
.So adding additional
once()
,twice()
,times(n)
invocation count methods will change the expectation behavior fromshouldNotReceive
toshouldReceive
.If the mock
shouldNotReceive
a call more or less thanx
times, use Call count modifiersatLeast()
oratMost()
.