test(phpunit): fix PHPUnit different CWD with a custom command

As per https://github.com/recca0120/vscode-phpunit/issues/385#issuecomment-3947799942

Also needed to set `XDEBUG_MODE`.

Generally works, but now I get test failures.
This commit is contained in:
rugk
2026-02-24 12:37:47 +00:00
parent 4192751004
commit 285f592e70

View File

@@ -2,14 +2,17 @@
"files.associations": { "files.associations": {
"**/cfg/conf*.php": "ini" "**/cfg/conf*.php": "ini"
}, },
"phpunit.environment": {
"XDEBUG_MODE": "coverage"
},
"phpunit.phpunit": "${userHome}/.composer/vendor/bin/phpunit", "phpunit.phpunit": "${userHome}/.composer/vendor/bin/phpunit",
"phpunit.command": "/bin/sh -c 'cd ${workspaceFolder}/tst && ${php} ${phpunit} ${phpunitargs}'",
"phpunit.args": [ "phpunit.args": [
"--configuration", "--configuration",
"${workspaceFolder}/tst/phpunit.xml", "${workspaceFolder}/tst/phpunit.xml",
"--bootstrap", "--bootstrap",
"${workspaceFolder}/tst/Bootstrap.php" "${workspaceFolder}/tst/Bootstrap.php"
], ],
"mochaExplorer.mochaPath": "js/node_modules/mocha",
"mochaExplorer.pkgFile": "js/package.json", "mochaExplorer.pkgFile": "js/package.json",
"mochaExplorer.files": "js/test/*.js" "mochaExplorer.files": "js/test/*.js"
} }