public function testForcefullyKill() { if (!$this->object->isAvailable()) { $this->markTestSkipped(); } $pid = $this->startProcess(); $this->object->kill($pid, true); usleep(500); $this->assertFalse($this->isRunning()); }
/** Check if there is a running daemon * * @return int|null */ protected function getRunningPid() { if (!file_exists($this->pidFilePath)) { return; } $pid = intval(trim(file_get_contents($this->pidFilePath))); if ($this->processControl->isRunning($pid, true)) { return $pid; } // Not found, remove the stale PID file unlink($this->pidFilePath); }