public function testGetSetLog() { $runner = new TaskRunner(); $log = new SchedulerLog(); $runner->setLog($log); $this->assertEquals($log, $runner->getLog()); }
/** * @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; } }