phpstan-mockery
phpstan-mockery copied to clipboard
PHPStan reports error when using alternative syntax of shouldReceive method
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?
must be fixed here
Any progress on this?
Can you at least send a failing test here?