예제 #1
0
 public function testProcess()
 {
     $event = new WebhookEvent();
     $event->setData(['feed_id' => self::$DI['feed_public_entry']->getFeed()->getId(), 'entry_id' => self::$DI['feed_public_entry']->getId()]);
     $event->setName(WebhookEvent::NEW_FEED_ENTRY);
     $event->setType(WebhookEvent::FEED_ENTRY_TYPE);
     $processor = new FeedEntryProcessor($event, self::$DI['app']);
     $this->assertEquals($processor->process(), null);
 }
 public function create($eventName, $type, array $data)
 {
     $event = new WebhookEvent();
     $event->setName($eventName);
     $event->setType($type);
     $event->setData($data);
     $this->update($event);
     return $event;
 }
예제 #3
0
 protected function insertWebhookEvent(EntityManager $em, \Pimple $DI)
 {
     $event = new WebhookEvent();
     $event->setName(WebhookEvent::NEW_FEED_ENTRY);
     $event->setType(WebhookEvent::FEED_ENTRY_TYPE);
     $event->setData(['feed_id' => $DI['feed_public_entry']->getFeed()->getId(), 'entry_id' => $DI['feed_public_entry']->getId()]);
     $em->persist($event);
     $DI['event_webhook_1'] = $event;
     $event2 = new WebhookEvent();
     $event2->setName(WebhookEvent::NEW_FEED_ENTRY);
     $event2->setType(WebhookEvent::FEED_ENTRY_TYPE);
     $event2->setData(['feed_id' => $DI['feed_public_entry']->getFeed()->getId(), 'entry_id' => $DI['feed_public_entry']->getId()]);
     $event2->setProcessed(true);
     $em->persist($event2);
 }