Assetic\Util\ProcessBuilder::setEnv PHP Method

setEnv() public method

public setEnv ( $name, $value )
    public function setEnv($name, $value)
    {
        if (null === $this->env) {
            $this->env = array();
        }

        $this->env[$name] = $value;

        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @test
  */
 public function shouldNotReplaceExplicitlySetVars()
 {
     $snapshot = $_ENV;
     $_ENV = array('foo' => 'bar');
     $expected = array('foo' => 'baz');
     $pb = new ProcessBuilder();
     $pb->setEnv('foo', 'baz')->inheritEnvironmentVariables()->add('foo');
     $proc = $pb->getProcess();
     $this->assertEquals($expected, $proc->getEnv(), '->inheritEnvironmentVariables() copies $_ENV');
     $_ENV = $snapshot;
 }
All Usage Examples Of Assetic\Util\ProcessBuilder::setEnv