/** * Create the job with all children configure * * @return Job */ public function getJob() { $this->resolveChildren(); $job = new Job($this->getJobConfig()); foreach ($this->children as $child) { $job->add($child->getJob()); } return $job; }
public function test_invalid_processor_should_fail() { $this->given($mockED = new \mock\Symfony\Component\EventDispatcher\EventDispatcherInterface(), $mockED->getMockController()->hasListeners = true, $this->mockGenerator->orphanize('__construct'), $mockExecution = new \mock\Rezzza\Jobflow\Scheduler\ExecutionContext(), $mockConfig = new \mock\Rezzza\Jobflow\JobConfig('alphonse', $mockED), $mockConfig->getMockController()->getProcessorConfig = 'hey you', $mockConfig->getMockController()->resolveExecOptions = ['jean' => 'marc'])->if($job = new TestedClass($mockConfig))->exception(function () use($job, $mockExecution) { $job->execute($mockExecution); })->hasMessage('processor should be a ProcessorConfig or a callable'); }
public function currentChild(Job $job) { return $job->get($this->current); }