Tester\Runner\Runner::addJob PHP 메소드

addJob() 공개 메소드

Appends new job to queue.
public addJob ( Job $job ) : void
$job Job
리턴 void
    public function addJob(Job $job)
    {
        $this->jobs[] = $job;
    }

Usage Example

예제 #1
0
 /**
  * @return void
  */
 public function initiate($file)
 {
     list($annotations, $testName) = $this->getAnnotations($file);
     $php = clone $this->runner->getInterpreter();
     $jobsArgs = array(array());
     foreach (get_class_methods($this) as $method) {
         if (!preg_match('#^initiate(.+)#', strtolower($method), $m) || !isset($annotations[$m[1]])) {
             continue;
         }
         foreach ((array) $annotations[$m[1]] as $value) {
             $res = $this->{$method}($value, $php, $file);
             if ($res && is_int($res[0])) {
                 // [Runner::*, message]
                 $this->runner->writeResult($testName, $res[0], $res[1]);
                 return;
             } elseif ($res && $res[1]) {
                 // [param name, values]
                 $tmp = array();
                 foreach ($res[1] as $val) {
                     foreach ($jobsArgs as $args) {
                         $args[] = Helpers::escapeArg("--{$res['0']}={$val}");
                         $tmp[] = $args;
                     }
                 }
                 $jobsArgs = $tmp;
             }
         }
     }
     foreach ($jobsArgs as $args) {
         $this->runner->addJob(new Job($file, $php, $args));
     }
 }
All Usage Examples Of Tester\Runner\Runner::addJob