Skip to content

Phake annotation recognition and mock class method completion  #19

@cuberinooo

Description

@cuberinooo

Sry for taking too long here are the issues in more details:

Phake Annotation:

Phake brings the feature that you can use annotation for mocking.
E.g.

#[\Phake\Mock]
private YourClassThatYouWantToMock $class;

and you will need to put this on your setUp Method:
\Phake::initAnnotations($this);

Unfortunately the plugin does not recognize the Annotation (see screenshot):
undefined class Mock

and if I import this the IDE will call "Import is not used" as you can see here:
mock_package is not used

Mock class method auto completion:

Lets say we have the following class that we want to mock:

class foo
{
    public function getBar(): string
    {
        return 'foo';
    }
}

I use the phake mock annotation to mock this class. (Also I could do this with the Phake::mock(...)

#[\Phake\Mock]
private Foo $foo;

I really would love to see a autocompletion for methods of mocked classes as in PHPUnit.

Here I would expect the getBar() Method as suggestion.
missing autocompletion for mock class foo

These are just minor issues as I already said Im really grateful for this plugin and with that I wanna say thank you again ;)

PS: Regarding to Phake Annotation I can`t say if this is a Plugin problem or a problem with the package itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions