コード例 #1
0
 public function testCheckAndRunTasks()
 {
     $task_inactive = TaskMock::createNew();
     $task = TaskMock::createNew();
     $task->setStatus(TaskInterface::TASK_STATUS_ACTIVE);
     $task->setTime('* * * * *');
     TaskRunner::checkAndRunTasks([$task, $task_inactive]);
 }
コード例 #2
0
 public function testGetTaskCrontabLine()
 {
     $task = TaskMock::createNew();
     $task->setStatus(TaskInterface::TASK_STATUS_INACTIVE);
     $task->setCommand('Class::method()');
     $task->setComment('comment');
     $task->setTime('* * * * *');
     $export = TaskManager::getTaskCrontabLine($task, 'path', 'php', 'index.php');
     $this->assertEquals("#comment\n#* * * * * cd path; php index.php Class method  2>&1 > /dev/null\n", $export);
 }