/** * @param Daemon $daemon * @param OutputLogger $logger */ protected function doStop(Daemon $daemon, OutputLogger $logger) { try { if ($daemon->stop()) { $logger->info('Daemon was stopped'); } } catch (\Exception $e) { $logger->info('Daemon already stopped'); } }
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()); }