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

Unknown methods on collaborators don't prompt method generation in some cases #1350

Closed
ciaranmcnulty opened this issue Dec 10, 2020 · 0 comments · Fixed by phpspec/prophecy#514 or #1352

Comments

@ciaranmcnulty
Copy link
Member

ciaranmcnulty commented Dec 10, 2020

In cases like this, we prompt to add the method signature to the interface:

function it_does_something(Collab $collab)
{
    $collab->someMethod()->willReturn();
}

however when a method is called inside the class being specced, we don't catch the error and prompt:

class  MyClassSpec extends ObjectBehaviour
{
    function it_does_something(Collab $collab)
    {
        $this->foo($collab);
    }
}
class  MyClass
{
    public function foo(Collab $collab)
    {
         $collab->someMethod();
    }
}

I think this may just be the case of handling additional Throwables inside CollaboratorMethodNotFoundListener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant