-
Notifications
You must be signed in to change notification settings - Fork 45
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 for methods added with addMethods phpunit function #87
Comments
I just encountered this issue with the code
Any recommendation @ondrejmirtes ? |
I created a reproducer: #93 |
I don't understand the use-case. If you're adding methods to the mock that don't exist on the mocked class, you'll also get PHPStan errors where you're calling the passed object in production code. e.g. |
The usecase is
Here, the method name |
Some situations where i use Some specific PDO driver functions e.g: https://www.php.net/manual/fr/pdo.pgsqlgetnotify.php |
|
The issue of @lugus and all the error I get is because we're adding methods to Since no method exist for \stdClass, what do you think about ignoring the method check for a mock of I made the change in #93 |
I was giving some use cases to reply your comment #87 (comment), it's indeed ok for |
I have other use case where a method expect an object with a specific interface (X), If the object implements another interface (Y) as well a specific method will be call. I want to test that if the object has the method of interface Y but don't implement the interface Y it will not be called. |
This issue might be closed since |
Thanks! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello, thank you for your work.
Reporting issue about the
onlyMethods
fromphpunit
, it looks thanphpstan-phpunit
do not check methods added with these method and raise an error.When:
The text was updated successfully, but these errors were encountered: