Esempio n. 1
0
 /**
  * @param \MyTester\Job $job
  * @return string
  */
 protected function runJob(Job $job)
 {
     $jobName = $this->getJobName(\Nette\Reflection\Method::from($job->callback[0], $job->callback[1]));
     Environment::$currentJob = $jobName;
     if (!$job->skip) {
         $this->setUp();
     }
     $job->execute();
     if (!$job->skip) {
         $this->tearDown();
     }
     Environment::$currentJob = "";
     switch ($job->result) {
         case "passed":
             return ".";
             break;
         case "skipped":
             return "s";
             break;
         case "failed":
             return "F";
             break;
     }
     return "";
 }
Esempio n. 2
0
 /**
  * run the job, then remove it from the joblist
  *
  * @param JobList $jobList
  * @param \OC\Log $logger
  */
 public function execute($jobList, $logger = null)
 {
     $jobList->remove($this, $this->argument);
     parent::execute($jobList, $logger);
 }
Esempio n. 3
0
 /**
  * run the job if
  *
  * @param JobList $jobList
  * @param \OC\Log $logger
  */
 public function execute($jobList, $logger = null)
 {
     if (time() - $this->lastRun > $this->interval) {
         parent::execute($jobList, $logger);
     }
 }