Example #1
0
 public function testClosingZenTerminatesProcess()
 {
     $this->process->expects($this->once())->method('isRunning')->will($this->returnValue(true));
     $this->process->expects($this->once())->method('terminate');
     $zen = new BaseZen();
     $zen->go($this->process);
     $zen->close();
 }
 public function testTerminatingProcessReturnsError()
 {
     $process = new Process('echo nevermind && cat');
     $process->start($this->loop);
     $zen = new BaseZen();
     $zen->go($process);
     $this->loop->addTimer(0.1, function () use($process) {
         $process->terminate(SIGKILL);
     });
     $this->loop->run();
     $zen->promise()->then(null, $this->expectCallableOnce());
 }