public function testGetPid() { if (defined('PHP_WINDOWS_VERSION_BUILD')) { $this->markTestSkipped('Unable to run on Windows'); } $this->process->expects($this->once())->method('getOutput')->will($this->returnValue($this->getPsOutput())); $this->assertEquals(111, $this->object->getPid()); }
/** * @param Daemon $daemon * * @return bool */ protected function needToRestart(Daemon $daemon) { if ($daemon->getPid()) { $interval = date_diff($daemon->getDateStart(), new \DateTime('now')); return (int) $interval->format('%d') >= 1; } return false; }