예제 #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();
 }
예제 #2
0
 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());
 }