Giter Club home page Giter Club logo

Comments (5)

freekmurze avatar freekmurze commented on June 6, 2024 2

Fixed in latest version.

from phpunit-watcher.

xipasduarte avatar xipasduarte commented on June 6, 2024 1

I have the same issue. I'm using PHP 7.2, everything ele is the same as @yjv-XCV.

from phpunit-watcher.

yjv-XCV avatar yjv-XCV commented on June 6, 2024

I actually found where the problems came from, but have no idea how to fix it.
in vendor/symfony/process/Process.php:229

$commandline = 'exec '.$commandline;

The command line is received from
vendor/spatie/phpunit-watcher/src/Screens/Phpunit.php:93
which is combination of phpunitBinaryPath and phpunitArguments.
However the problem lies when it execute exec, it take the space, and the arguments as part of the file name.
When I didn't apply any phpunit arguments, it will have a space after the phpunitBinaryPath in the $commandline, and it works after I remove the space from it.
From

$commandline; // output: "exec /myprojectPath/vendor/bin/phpunit "

change to

$commandline; // output: "exec /myprojectPath/vendor/bin/phpunit"

Please advise, if any setting need to be done to make the execution will escape the space, and treat the arguments properly.

from phpunit-watcher.

yjv-XCV avatar yjv-XCV commented on June 6, 2024

After I modify
vendor/spatie/phpunit-watcher/src/Screens/Phpunit.php:93
from

$result = (new Process(["{$this->phpunitBinaryPath} {$this->phpunitArguments}"]))

to

$result = (new Process(["{$this->phpunitBinaryPath}", "{$this->phpunitArguments}"]))

it works fine.
Not sure if it will break other logic of the application.

from phpunit-watcher.

xipasduarte avatar xipasduarte commented on June 6, 2024

That's great @yjv-XCV. This change works for me too.

I dug a little deeper in the docs for Symfony Process and according to the documentation since v3.4 that's how it should be, the command separate from the arguments. Only from v3.3 below do we find the signature that is in phpunit-watcher.

I would suggest you open a PR with the change, although we no longer need the string wrap on the arguments:

$result = (new Process([$this->phpunitBinaryPath, $this->phpunitArguments]));

from phpunit-watcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.