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

Fix the class attached to methodnotfoundexception #514

Merged

Conversation

ciaranmcnulty
Copy link
Member

The class was always being set to ObjectProphecy, which causes issues when trying to work out which class the method was not found on

An alternative would have been to use $this->getProphecy()->reveal() but that may cause side effects

Fixing this resolves phpspec/phpspec#1350

@stof
Copy link
Member

stof commented Dec 11, 2020

this now passes a string rather than an object. Is it expected ?

@ciaranmcnulty
Copy link
Member Author

ciaranmcnulty commented Dec 11, 2020

@stof the exception's constructor parameter is object|string and the accessor is called getClassname with no return type. There is one other place this is thrown and it's already being thrown as a string, so hopefully consumers expect it.

The class was always being set to ObjectProphecy, which causes issues when trying to work out which class the method was not found on

An alternative would have been to use $this->getProphecy()->reveal() but that may cause side effects
@ciaranmcnulty ciaranmcnulty merged commit 2bb3b8b into phpspec:master Dec 19, 2020
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

Successfully merging this pull request may close these issues.

Unknown methods on collaborators don't prompt method generation in some cases
2 participants