Exemplo n.º 1
0
 /**
  * @test
  */
 public function it_publishes_the_event_in_the_QueuePublisher()
 {
     $event = new Event('SomethingHappened');
     $this->serializer->shouldReceive('serialize')->with($event)->andReturn('serialized');
     $this->queuePublisher->shouldReceive('publish')->with('serialized', 'SomethingHappened')->once();
     $this->listener->handle($event);
 }
Exemplo n.º 2
0
 /**
  * Handle an event.
  *
  * @param EventInterface $event
  *
  * @return void
  */
 public function handle(EventInterface $event)
 {
     $this->publisher->publish($this->serializer->serialize($event), $event->getName());
 }