コード例 #1
0
 public function test_run_with_exec()
 {
     $handler = new Accumulator();
     $process = new Process(Command::make('exec ls')->withArgs('-l'));
     $process->runAsync($handler)->wait();
     $this->assertEquals(0, $process->getExitCode());
     $this->assertEmpty($handler->stderr);
     $this->assertNotEmpty($handler->stdout);
     $this->assertFalse($process->isAlive());
 }
コード例 #2
0
 /**
  * ProcessException constructor.
  *
  * @param string $message
  * @param Process $process
  * @param Exception|null $previous
  */
 public function __construct($message, Process $process, Exception $previous = null)
 {
     parent::__construct($message, $process->getExitCode(), $previous);
 }