示例#1
0
 /**
  * @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;
 }
 public function testStop()
 {
     $this->process->expects($this->once())->method('getOutput')->will($this->returnValue($this->getPsOutput()));
     $this->process->expects($this->once())->method('isSuccessful')->will($this->returnValue(true));
     $this->assertTrue($this->object->stop());
 }