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->getRawParameters()->willReturn(['delimiter' => ';']);
     $this->normalize($jobinstance)->shouldReturn(['code' => 'product_export', 'label' => 'Product export', 'connector' => 'myconnector', 'type' => 'EXPORT', 'configuration' => '{"delimiter":";"}']);
 }
Ejemplo n.º 2
0
 /**
  * Get the associated jobInstance label
  *
  * @return string
  */
 public function getLabel()
 {
     return $this->jobInstance->getLabel();
 }
 /**
  * {@inheritdoc}
  *
  * @param JobInstance $object
  */
 public function normalize($object, $format = null, array $context = [])
 {
     $results = ['code' => $object->getCode(), 'label' => $object->getLabel(), 'connector' => $object->getConnector(), 'type' => $object->getType(), 'configuration' => $this->normalizeConfiguration($object)];
     return $results;
 }