/** * {@inheritdoc} */ public function removeSchedule(ScheduleInterface $schedule) { if ($schedule instanceof Schedule) { $schedule->setJob(null); } parent::removeSchedule($schedule); }
/** * 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); }
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()); } }