Markk's avatar
Level 4

VScode phpunit test

Untill a while ago i could do the unit testing fine with shortcut which i assigned but now it only works if i manually type in the console php vendor/phpunit/phpunit/phpunit.

When i place the cursor inside or on the method name and try to do the test using the keybind it opens a small window in vscode to configure tasks?

https://imgur.com/a/s6qqXSQ

Has anyone encoutered a simillar problem to this or know the solution for this problem?

Thanks in advance

0 likes
5 replies
Markk's avatar
Level 4

I did reinstall the plugin but the problem still occurs. I am running latest versions of both, VSCode on 1.41.1 and the plugin is on 1.5.2. I guess i need to wait for some newer update to fix the issue.

Markk's avatar
Level 4

@sti3bas I am doing the new code katas with phpunit, but when i set up the php unit via composer and try to run the first test with vendor\bin\phpunit or vendor\bin\phpunit --filter methodname, the console just gives me config for the phpunit, nothing gets tested. Do you maybe know what am i doing wrong... i got used to that plugin and now i'm kinda lost. Thanks

Sti3bas's avatar

@markk I'm also using 1.5.2 version on VSCode 1.41.1 and it works without any problems. If you click cmd+shift+p and choose Better PHPUnit: run does it work? If so, you should check your keybindings, I think I've also had this problem in the past.

Markk's avatar
Level 4

@sti3bas Yeah i tried with cmd+shift+p still get the same thing as using the keybind i assigned.

Please or to participate in this conversation.