psalm-plugin-phpunit icon indicating copy to clipboard operation
psalm-plugin-phpunit copied to clipboard

False `DeprecatedMethod` positives for `expects`

Open leighman opened this issue 3 years ago • 0 comments

Not sure if this is a psalm issue but thought I'd come here to clarify how stubs work. Using PHPUnit 7 which has

    /**
     * Registers a new expectation in the mock object and returns the match
     * object which can be infused with further details.
     *
     * @return InvocationMocker
     */
    public function expects(Invocation $matcher);

in MockObject. This doesn't seem to appear in the stub but no error in IDE (possibly because psalm warning level is not high enough?)

When calling createMock(MyClass::class) and deprecating __call on MyClass, I get errors about DeprecatedMethod for uses of expects. Is that expected behaviour or is something incorrect?

leighman avatar Oct 05 '20 02:10 leighman