Webmozart\Console\Adapter\ArgsInput::setArgument PHP Method

setArgument() public method

public setArgument ( $name, $value )
    public function setArgument($name, $value)
    {
        if ($this->args) {
            $this->args->setArgument($name, $value);
        }
    }

Usage Example

Esempio n. 1
0
 public function testSetArgument()
 {
     $inputArgs = new ArgsInput($this->rawArgs, $this->args);
     $inputNoArgs = new ArgsInput($this->rawArgs);
     $inputArgs->setArgument('argument1', 'value1');
     $inputNoArgs->setArgument('argument1', 'value1');
     $this->assertSame('value1', $inputArgs->getArgument('argument1'));
     $this->assertNull($inputNoArgs->getArgument('argument1'));
 }