예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function removeSchedule(ScheduleInterface $schedule)
 {
     if ($schedule instanceof Schedule) {
         $schedule->setJob(null);
     }
     parent::removeSchedule($schedule);
 }
예제 #2
0
 /**
  * Constructor.
  *
  * @param ObjectManager       $om
  * @param string              $class
  * @param ScheduleManager     $scheduleManager
  * @param SerializationHelper $serializationHelper
  */
 public function __construct(ObjectManager $om, $class, ScheduleManager $scheduleManager, SerializationHelper $serializationHelper)
 {
     $this->objectManager = $om;
     $this->repository = $om->getRepository($class);
     $this->scheduleManager = $scheduleManager;
     $metadata = $om->getClassMetadata($class);
     $this->class = $metadata->getName();
     Job::setSerializationHelper($serializationHelper);
 }
예제 #3
0
 public function testGetResponseWithSerializerException()
 {
     $job = new Job();
     $job->setType('JobType');
     $this->setProperty($job, 'serializedResponse', 'SerializedResponse');
     $this->serializationHelper->expects($this->any())->method('deserializeReturnValue')->willThrowException(new \Exception('Some deserialization error'));
     try {
         $job->getResponse();
     } catch (\Exception $e) {
         $this->assertNull($job->getResponse());
     }
 }