Exemplo n.º 1
0
 protected function setGlobalInput()
 {
     $inputDefinition = new InputDefinition();
     $inputDefinition->addOptions(array(new InputOption('system_path', null, InputOption::VALUE_OPTIONAL, 'The path to your system folder', null), new InputOption('http_host', null, InputOption::VALUE_OPTIONAL, 'The HTTP_HOST to spoof in $_SERVER', null), new InputOption('document_root', null, InputOption::VALUE_OPTIONAL, 'The DOCUMENT_ROOT to spoof in $_SERVER', null), new InputOption('request_uri', null, InputOption::VALUE_OPTIONAL, 'The REQUEST_URI to spoof in $_SERVER', null), new InputOption('remote_addr', null, InputOption::VALUE_OPTIONAL, 'The REMOTE_ADDR to spoof in $_SERVER', null), new InputOption('user_agent', null, InputOption::VALUE_OPTIONAL, 'The HTTP_USER_AGENT to spoof in $_SERVER', null)));
     $this->globalInput = new GlobalArgvInput(null, true);
     $this->globalInput->bind($inputDefinition);
 }
Exemplo n.º 2
0
 public function testAddOptions()
 {
     $this->initializeOptions();
     $definition = new InputDefinition(array($this->foo));
     $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOptions() adds an array of InputOption objects');
     $definition->addOptions(array($this->bar));
     $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOptions() does not clear existing InputOption objects');
 }