Ok, cancel all that, it turns out that in my settings.json I had
"phpunit.args": [
"--coverage-html coverage-html"]
which is clearly wrong, it should have been
"phpunit.args": [
"--coverage-html", "coverage-html"]
Hi All,
I have tried to go down the test coverage path with phpunit in vscode for laravel projects a few times over the last few years and always end up giving up in disgust. Normally its because if Xdebug but on this occasion its not. It's some weird nuance in VSCODE that is driving me bonkers.
When I try and run tests, either individually, or all at once, through the PHPUnit Test Explorer, I get the nice message saying PHPUnit 9.5.13 by Sebastian...... and then the next line says "Unknown option --coverage-html output", which to me implies it has found php, found phpunit, read my config file where I have told it about the coverage-html argument, and then for some reason, phpunit thinks its not an option it knows about.
With full verbose logging turned on, I can see it is running /opt/homebrew/bin/php, I can see it is running vendor/bin/phpunit, and I can see the exact string that is the coverage flag. If I copy each of those three elements onto a zsh command line and run them together, with absolute paths as per the log file, it works.... yet it wont work in vscode........ I am genuinely stumped..... all suggestions welcomed.
Ok, cancel all that, it turns out that in my settings.json I had
"phpunit.args": [
"--coverage-html coverage-html"]
which is clearly wrong, it should have been
"phpunit.args": [
"--coverage-html", "coverage-html"]
Please or to participate in this conversation.