Пример #1
0
 /**
  * @param string $command
  * @param array $arguments
  * @return string
  */
 public static function execute($command, $arguments)
 {
     $builder = new Builder();
     $builder->addCommand($command);
     $builder = static::processArguments($builder, $arguments);
     $runner = new SymfonyProcess();
     $runner->run($builder, static::$returnClosure);
     return $runner;
 }
Пример #2
0
 public function testFailedSymfonyProcessCommand()
 {
     $x = new Builder();
     $x->addCommand('dat1e')->addParameter('+%d-%m-%Y');
     $r = new SymfonyProcess();
     $r->run($x);
     $this->assertSame("dat1e '+%d-%m-%Y'", $r->getLastCommand());
     $this->assertSame('', trim($r->getOutput()));
     $this->assertSame(127, $r->getStatus());
 }