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 testClosingZenResolvesWithOutputSoFar() { $process = new Process('echo okay && cat && echo not'); $process->start($this->loop); $zen = new BaseZen(); $zen->go($process); $this->loop->addTimer(0.1, function () use($zen) { $zen->close(); }); $this->loop->run(); $zen->promise()->then($this->expectCallableOnceWith('okay')); }