/** * @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); }