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

Tests not executing

Open programmende opened this issue 5 years ago • 6 comments

Hi there,

i can't run tests with this extension. All tests will fail and i get the following output in PHPUnit LanguageServer window:

@ECHO OFF setlocal DISABLEDELAYEDEXPANSION SET BIN_TARGET=%~dp0/../phpunit/phpunit/phpunit php "%BIN_TARGET%" %*

I use Windows 10 and the general PHP and PHPUnit setup works.

Can you help?

Best regards Chris

programmende avatar Aug 20 '19 09:08 programmende

I had the same issue. For me I opened in vscode

Settings -> Extensions -> PHPUnit Configuration

About 8 settings down there is "Phpunit: Phpunit" Path to phpunit.

Setting this fixed my issue.

saltzmanjoelh avatar Aug 22 '19 18:08 saltzmanjoelh

Dosn't work for me.

I have set the following setting: "phpunit.phpunit": "${workspaceFolder}\vendor\bin\phpunit",

I use Laravel Framework and the phpunit executable exists in bin/phpunit

This is the message in PHPUnit LanguageServer window now: spawn ${workspaceFolder}\vendor\bin\phpunit ENOENT

programmende avatar Aug 25 '19 12:08 programmende

Try an absolute path. ENOENT means the file doesn't exist. In my case I had the wrong file extension.

saltzmanjoelh avatar Aug 26 '19 06:08 saltzmanjoelh

I'm rewriting this project now, it will fix this issue at next version

recca0120 avatar Nov 22 '19 14:11 recca0120

Thanks @recca0120 do you have any ETA about this? At least a suggestion on how I should set the phpunit.phpunit value since it seems to be broken. My vendor directory is in app/vendor and I couldn't set a proper relative path. None of these worked.

"phpunit.phpunit": "app/vendor/bin/phpunit" <-- It should search for phpunit OR phpunit.bat
"phpunit.phpunit": "app/vendor/bin/phpunit.bat"
"phpunit.phpunit": "${workspaceFolder}/app/vendor/bin/phpunit"
"phpunit.phpunit": "${workspaceFolder}/app/vendor/bin/phpunit.bat"
"phpunit.phpunit": "${workspaceFolder}\\app\\vendor\\bin\\phpunit"
"phpunit.phpunit": "${workspaceFolder}\\app\\vendor\\bin\\phpunit.bat"

I always get:

spawn \${workspaceFolder}\app\vendor\bin\phpunit.bat ENOENT

Please notice it prepends a \ and it doesn't seem to resolve ${workspaceFolder}.

For now I'm using an absolute path but I want to really really really want to avoid that. It breaks multiplatform compatibility and - heck - it even breaks my PC at home if I ever wanted to commit the .vscode directory.

"phpunit.phpunit": "C:\\Users\\User\\my-project\\app\\vendor\\bin\\phpunit.bat",

Thanks.

PS. It think this is a duplicate of https://github.com/recca0120/vscode-phpunit/issues/39

MorenoGentili avatar Feb 07 '20 11:02 MorenoGentili

Any news on this issue? I'm running into the same problems as the others in this thread. I've written an absolute path to phpunit.bat and it appears it's correct, as I now get this message, which is the content of the phpunit.bat file.

"@ECHO OFF setlocal DISABLEDELAYEDEXPANSION SET BIN_TARGET=%~dp0/../phpunit/phpunit/phpunit php "%BIN_TARGET%" %* "

I'm using Laravel. I'm not sure what else I can try to figure it out.

I'd really like to get this working. The Test explorer is super cool, but tests can't run. I'm stuck with running them manually from Powershell.

Thanks!

eugenlisov avatar Apr 17 '20 13:04 eugenlisov

try version 3.0

recca0120 avatar Dec 06 '22 05:12 recca0120