Hello,
I have a problem configuring phpunit in VS Code.
I'm using ddev (windows + wsl2), and can't use phpunit properly because the filter is broken:
my config for it is just the following
“phpunit.command": ‘ddev exec php ./vendor/bin/phpunit ${phpunitargs}’,
“php.executablePath": ‘ddev exec php’,
"phpunit.paths": {
"${workspaceFolder}": "."
}
This is the Output from PHPUnit
Running tests ...
> ${cwd} = /home/user/projects/middleware
> ${phpunitxml} = /home/user/projects/middleware/phpunit.xml
> ddev exec php ./vendor/bin/phpunit -c phpunit.xml --teamcity --colors=never --filter “(^(Tests.Unit.ExampleTest::test_that_true_is_true(\s.*)?)$)” “/home/user/projects/middleware/tests/Unit/ExampleTest.php”
Process #89445 was closed with exit code 1.
When I run the command in the terminal with -d display_errors=on, I get this error message:
bash: -c: line 1: syntax error near unexpected token `('
bash: -c: line 1: `set -eu && ( php -d display_errors=on ./vendor/bin/phpunit -c phpunit.xml --teamcity --colors=never --filter (^(Tests.Unit.ExampleTest::test_that_true_is_true(\s.*)?)$) /home/user/projects/middleware/tests/Unit/ExampleTest.php)'
If i setup “phpunit.command": "ddev exec php -d display_errors=on ./vendor/bin/phpunit -c phpunit.xml --teamcity --colors=never" it executed the tests but all.
i have tested it in the pre-release and in the current version.
Any hints the filter does not work and why it takes my local path as cwd and not the path from the container?
Thanks for your help!