Alexandre Guichet
Alexandre Guichet

Reputation: 43

PHPUnit .bat file not receiving any inputs

I have a problem with my phpunit.bat file. I can access the phpunit.phar just fine through the terminal. I think it's worth mentioning it was working yesterday without problem before I tried to install the extension PHPUnit Test Explorer. I've uninstalled it since but the error is still here. I wonder why vscode doesn't send anything to the .bat file (from my understanding I could gather from internet on this issue).

This is the results I get when I access to phpunit through the terminal as an environment variable: enter image description here

But when I try to run the test through the command palette, I get nothing from the unit test. enter image description here

enter image description here

My phpunit.bat is as follow. I don't understand why it works through the terminal and not the command palette.

enter image description here

and my settings.json is

{
"files.autoSave": "afterDelay",
"debug.allowBreakpointsEverywhere": true,
"diffEditor.ignoreTrimWhitespace": false,
"launch": {

    "configurations": [],
    "compounds": []
},
"php.validate.executablePath": "F:/Xampp/php/php.exe",
"intelephense.environment.phpVersion": "7.1.32",
"phpunit.phpunit": "C:/dev/phpunit.bat",
"phpunit.php": "F:/Xampp/php/php.exe",
"phpunit.files": "ESO DECRYPTE/classes/tests/*Test.php",
"phpunit.args": [],
}

Please advise! Thanks a lot.

Best,

Upvotes: 1

Views: 90

Answers (1)

Alexandre Guichet
Alexandre Guichet

Reputation: 43

So I've fixed the problem by changing from the "phpunit.phpunit" variable from .bat to .phar in settings.json. I don't know why the .bat stopped working.

Now both PHPUnit and PHPUnit Test Explorer works!

Upvotes: 1

Related Questions