vscode-intelephense icon indicating copy to clipboard operation
vscode-intelephense copied to clipboard

Add support for PHPSpec and Prophecy matchers

Open shulard opened this issue 5 years ago • 9 comments

Feature description or problem with existing feature

I'm using your extension for a while now but I have trouble when using PHPSpec + Prophecy because it miss specific method understanding (even on the premium version).

As you can see in the following picture, most of the assertions methods are marked unknown :

Screenshot 2020-09-23 at 10 16 37

Describe the solution you'd like

Since inside a spec file, every object injected in methods is constructed as a mock ("prophet" in the Prophecy world), it's not a real instance. Every method exists but must be configured with assertions / expectations. All the willReturn, shouldBeXXX are valid.

Same for the current object instance, when using $this every method for the currently specified object is available and the return value is a spy object that can be tested.

I don't know if you are familiar with these tools, I can help if necessary :smile:.

shulard avatar Sep 23 '20 08:09 shulard

+1

gvanbeck avatar Nov 24 '20 12:11 gvanbeck

I am also looking to add autocomplete for prophecy but it seems it is not as easy as other libraries/frameworks. It looks like prophecy is using a lot of "magic" (reference).

alexkuc avatar Jan 02 '21 06:01 alexkuc

+1

mikedfunk avatar Apr 15 '22 23:04 mikedfunk

Is there any status update on this?

gvanbeck avatar Nov 22 '22 08:11 gvanbeck

+1

kmatulewicz avatar Mar 20 '23 13:03 kmatulewicz

+1

emircanerkul avatar Apr 03 '23 14:04 emircanerkul

+1

victordev13 avatar Feb 01 '24 12:02 victordev13

+1

kalifg avatar Apr 16 '24 22:04 kalifg