Exemplo n.º 1
0
 public function testSetGetTask()
 {
     $runner = new TaskRunner();
     $task = new AlphabetTask();
     $runner->setTask($task);
     $this->assertEquals($task, $runner->getTask());
 }
 /**
  * @param Task $task
  */
 private function runTask(Task $task)
 {
     echo sprintf("\tRunning %s...", $task->getName());
     if ($task->shouldRun($this->force)) {
         $runner = new TaskRunner();
         $runner->setTask($task);
         $runner->setLog(new SchedulerLog());
         $runner->runTask($this->force);
         echo $runner->error ? 'error' : 'done' . PHP_EOL;
     } else {
         echo "Task is not due, use --force to run anyway" . PHP_EOL;
     }
 }