コード例 #1
0
 public function testMethods()
 {
     $event = new PamiEvent();
     $pamiEvent = $this->getMockBuilder('PAMI\\Message\\Event\\EventMessage')->disableOriginalConstructor()->getMock();
     /* @var \PAMI\Message\Event\EventMessage $pamiEvent */
     $event->setEvent($pamiEvent);
     static::assertSame($pamiEvent, $event->getEvent());
 }
コード例 #2
0
 /**
  * Forward PAMI event to EventManager.
  *
  * @param EventMessage $e PAMI event
  */
 public function handle(EventMessage $e)
 {
     $eventPrefix = 'event.';
     $eventName = $eventPrefix . $e->getName();
     $event = new PamiEvent();
     $event->setName($eventName);
     $event->setTarget($this->client);
     $event->setEvent($e);
     $this->client->getEventManager()->triggerEvent($event);
 }