Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spaces in file path in windows 10 #37

Closed
S-M-O opened this issue Sep 13, 2019 · 9 comments
Closed

Spaces in file path in windows 10 #37

S-M-O opened this issue Sep 13, 2019 · 9 comments

Comments

@S-M-O
Copy link

S-M-O commented Sep 13, 2019

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

@elonmallin
Copy link
Owner

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.

@S-M-O
Copy link
Author

S-M-O commented Sep 13, 2019

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

@elonmallin
Copy link
Owner

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 =)

@Shujee
Copy link

Shujee commented Jan 15, 2024

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.

@elonmallin
Copy link
Owner

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.

@elonmallin elonmallin reopened this Jan 18, 2024
@Shujee
Copy link

Shujee commented Jan 19, 2024

Thanks. I'll see if I can manage to submit a PR (workload tides are high after holidays).

@elonmallin
Copy link
Owner

Thanks, no rush. I think the fix is somewhere around here

@leonidasmi
Copy link

Could there be maybe a temporary workaround until the fix is out? Thanks in advance :)

@elonmallin
Copy link
Owner

This should be fixed now in 4.16.0. Could you update and have a look please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants