function it_normalizes_job_instance(JobInstance $jobinstance) { $jobinstance->getCode()->willReturn('product_export'); $jobinstance->getLabel()->willReturn('Product export'); $jobinstance->getConnector()->willReturn('myconnector'); $jobinstance->getType()->willReturn('EXPORT'); $jobinstance->getRawConfiguration()->willReturn(['delimiter' => ';']); $this->normalize($jobinstance)->shouldReturn(['code' => 'product_export', 'label' => 'Product export', 'connector' => 'myconnector', 'type' => 'EXPORT', 'configuration' => ['delimiter' => ';']]); }
/** * Get a registered job definition from a JobInstance * * @param JobInstance $jobInstance * * @return JobInterface * @throws \LogicException */ public function getJob(JobInstance $jobInstance) { if ($connector = $this->getConnector($jobInstance->getConnector(), $jobInstance->getType())) { if ($job = $this->getConnectorJob($connector, $jobInstance->getAlias())) { $job->setConfiguration($jobInstance->getRawConfiguration()); $jobInstance->setJob($job); return $job; } } return null; }
/** * {@inheritDoc} */ public function getConnector() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getConnector', array()); return parent::getConnector(); }