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

PHPStan reports error when using alternative syntax of shouldReceive method #15

Open
hhovakimyan opened this issue Mar 19, 2020 · 3 comments

Comments

@hhovakimyan
Copy link

Hi
I am using PHPStan version 0.12.2 and phpstan/phpstan-mockery version 0.12.3.
My code looks like this:

$validatorMock = \Mockery::spy('alias:' . Validator::class);
$validatorMock->shouldReceive(['isValueValid' => false]);

I am mocking Validator class, which has static method isValueValid.
And PHPStan reports error:

Parameter #1 ...$methodNames of method Mockery\LegacyMockInterface::shouldReceive() expects string, array<string, false> given.

However when I change the syntax to
$validatorMock->shouldReceive('isValueValid')->andReturn(false);
PHPStan does not report an error then. Must be this problem fixed in this package or not?

@adaamz
Copy link
Contributor

adaamz commented Oct 21, 2020

must be fixed here

@braaibander
Copy link

Any progress on this?

@ondrejmirtes
Copy link
Member

Can you at least send a failing test here?

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

No branches or pull requests

4 participants