/**
  * Test `started` manual callback
  */
 public function testStoppedManual()
 {
     $this->TaskClient->add('ls', '', array('-l'));
     $task = $this->TaskServer->getPending();
     $this->TaskServer->stopped($task, true);
     $startedTask = $this->TaskClient->find('first', array('conditions' => array('id' => $task['id'])));
     $this->assertEqual($startedTask['Task']['status'], TaskType::STOPPED);
 }
Пример #2
0
 /**
  * Notify client about stopped task
  * 
  * @param bool $manual True means process stopped manually
  */
 protected function _stopped($manual = false)
 {
     $this->_task = array('stdout' => $this->_Process->getOutput(), 'stderr' => $this->_Process->getErrorOutput(), 'stopped' => $this->_getCurrentDateTime(), 'process_id' => 0) + $this->_task;
     $this->_TaskServer->stopped($this->_task, $manual);
     $this->_Shell->out("Task #{$this->_task['id']} stopped, code " . (string) $this->_task['code']);
 }