Given the following example, i'd expect PHPStan to report the following issues:
- The parameter types in
with don't match the function signature
- The return value does not match the function signature.
This would be usefull for projects with a large test suite, where you do a refactor of a method that is used in a lot of places. It would allow to fix these issues before running the entire test suite to get the errors from PHPUnit.
class T1 {
public function myMethod(int $a, string $b): int {
return 3;
}
}
class T1Test extends TestCase {
public function testStuff(): void {
$mock = $this->createMock(T1::class);
$mock->expects($this->once())
->method('myMethod')
->with(
new \stdClass(),
new \stdClass(),
)->willReturn(true);
}
}
Given the following example, i'd expect PHPStan to report the following issues:
withdon't match the function signatureThis would be usefull for projects with a large test suite, where you do a refactor of a method that is used in a lot of places. It would allow to fix these issues before running the entire test suite to get the errors from PHPUnit.