Spaces in file path in windows 10
Closed this issue · 9 comments
Hello,
I saw there is already an issue concerning spaces in the path for the resource file but I am having this issue too. Is there a way I would be able to configure this correctly?
This here is the output when I try to execute a test
> Executing task in folder html: php c:/Users/Stefan Name/Documents/test/phpunit.phar "c:/Users/Stefan Name/Documents/test/test.php" --filter test1 <
Could not open input file: c:/Users/Stefan
The terminal process terminated with exit code: 1
Any ideas how to solve this?
Thank you very much and best regards,
Stefan
Hi, could you try setting the phpunit.phpunit setting directly with quotationmarks? In the end it's just a cmd command so c:/Users/etc needs to be wrapped in " if there are spaces in the string.
Hello,
Thank you for your fast answer. I tried to set it directly in the user settings.json but it did not change the resulting execution block which is without quotation marks.
Best regards,
Stefan
It should be possible to use the windows short path. If you open a cmd
at C:/Users
and run dir /x
you should see something like Stefan~1
. You can use that in place of Stefan Name
.
Committed a fix that will wrap the phpunit
path in single quotes ('
) also =)
I'm seeing this behavior in v4.14.0
. My root project folder name contains a space and I get this in the terminal when trying to execute a test function in VSCode:
Executing task: php 'C:\My Laravel Project\vendor\phpunit\phpunit\phpunit' --colors=always --filter 'test_json_files' C:\My Laravel Project/tests/Feature/ParsingTest.php
Test file "C:\My" not found
So basically it is injecting test file path without quotes into command arguments where it breaks on the first space.
My PHPUnit version is 10.4.1
.
Ok spaces problems are back :( Are you interested in creating a PR?
Think what's needed is adding the quotes in the phpunit args builder class where the file name is added and creating a test case for it to make sure it works.
Thanks. I'll see if I can manage to submit a PR (workload tides are high after holidays).
Thanks, no rush. I think the fix is somewhere around here
Could there be maybe a temporary workaround until the fix is out? Thanks in advance :)
This should be fixed now in 4.16.0. Could you update and have a look please.