public function testDoNotSerializeWhenFormatNotSet()
{
$serializerProphecy = $this->prophesize(SerializerInterface::class);
$serializerProphecy->serialize()->shouldNotBeCalled();
$eventProphecy = $this->prophesize(GetResponseForControllerResultEvent::class);
$eventProphecy->getControllerResult()->willReturn(new \stdClass())->shouldBeCalled();
$eventProphecy->getRequest()->willReturn(new Request())->shouldBeCalled();
$serializerContextBuilderProphecy = $this->prophesize(SerializerContextBuilderInterface::class);
$serializerContextBuilderProphecy->createFromRequest()->shouldNotBeCalled();
$listener = new SerializeListener($serializerProphecy->reveal(), $serializerContextBuilderProphecy->reveal());
$listener->onKernelView($eventProphecy->reveal());
}