vscode-phpunit
vscode-phpunit copied to clipboard
Tests not executing
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
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.
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
Try an absolute path. ENOENT means the file doesn't exist. In my case I had the wrong file extension.
I'm rewriting this project now, it will fix this issue at next version
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
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!
try version 3.0