Author: Kévin Dunglas (dunglas@gmail.com)
Ejemplo n.º 1
0
 /**
  * @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
  * @expectedExceptionMessage Not Found
  */
 public function testInvalidRouteFormat()
 {
     $request = new Request([], [], ['_api_resource_class' => 'Foo', '_format' => 'invalid']);
     $eventProphecy = $this->prophesize(GetResponseEvent::class);
     $eventProphecy->getRequest()->willReturn($request)->shouldBeCalled();
     $event = $eventProphecy->reveal();
     $listener = new AddFormatListener(new Negotiator(), ['json' => ['application/json']]);
     $listener->onKernelRequest($event);
 }