Skip to content
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 shouldNotReceive #26

Merged
merged 1 commit into from
Feb 5, 2021
Merged

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Feb 3, 2021

This fixes the issue when using:

$this->fooMock->shouldNotReceive('doFoo')->andReturn('bar');
// Call to an undefined method Mockery\ExpectationInterface|Mockery\HigherOrderMessage::andReturn()

Fixes #11
Closes #9

@ruudk ruudk force-pushed the should-not-receive branch from 6d8eb69 to ab0dd99 Compare February 3, 2021 08:39
This fixes the issue when using:

```
$this->fooMock->shouldNotReceive('doFoo')->andReturn('bar');
// Call to an undefined method Mockery\ExpectationInterface|Mockery\HigherOrderMessage::andReturn()
```

Add tests for `shouldHaveReceived` and `shouldNotHaveReceived`.

Fixes #11
@ruudk ruudk force-pushed the should-not-receive branch from acfb5b0 to 2b1b760 Compare February 3, 2021 08:43
@ruudk
Copy link
Contributor Author

ruudk commented Feb 5, 2021

@ondrejmirtes Do you think I should add all methods from https://github.com/mockery/mockery/blob/master/library/Mockery/LegacyMockInterface.php? Or is this enough?

@ondrejmirtes
Copy link
Member

@ruudk I'm not sure, try to "break" this when LegacyMockInterface is involved, if you won't be able to, then I guess not :)

Thank you!

@ondrejmirtes ondrejmirtes merged commit 053bf9e into phpstan:master Feb 5, 2021
@ruudk ruudk deleted the should-not-receive branch February 5, 2021 12:15
@ruudk ruudk restored the should-not-receive branch February 5, 2021 12:15
@ruudk ruudk deleted the should-not-receive branch February 5, 2021 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Call to an undefined method Mockery\ExpectationInterface|Mockery\ExpectsHigherOrderMessage::once()
2 participants