habitat icon indicating copy to clipboard operation
habitat copied to clipboard

habitat + paratest + symfony/console v3.4.0 misses env var PATH to /usr/local/bin/php (or similair)

Open andrederoos opened this issue 7 years ago • 3 comments

Since the release of symfony/console v3.4.0, it sets the $_ENV variable.

  • class Environment, function getAll() normally returned the parsed phpinfo.
  • since the $_ENV is set, getAll() returns that, missing the PATH.
  • paratest runs phpunit, but without a path set, we get in our setup env: php: No such file or directory

current code (line 33):

public function getAll()
    {
        if ($_ENV) return $_ENV;

        $info = $this->getPhpInfo();
        $_ENV = $this->parser->parse($info);

        return $_ENV;
    }

suggestion:

public function getAll()
    {
        $info = $this->getPhpInfo();
        $_ENV = array_merge($this->parser->parse($info), $_ENV);

        return $_ENV;
    }

andrederoos avatar Oct 12 '17 18:10 andrederoos

@andrederoos huh - doesn't seem like that will hurt anything. If you want to get a pull request with your suggested patch, and a matching test - then I would be happy to merge this.

brianium avatar Oct 12 '17 18:10 brianium

little bit rusty with writing tests, but sure, i'll create a PR! We love to use paratest 👍

andrederoos avatar Oct 12 '17 19:10 andrederoos

awesome! thanks! I'm glad you find it useful 😄

brianium avatar Oct 12 '17 19:10 brianium