/**
  * @dataProvider headerDataProvider
  */
 public function testHeadersSetter($headers)
 {
     $exception = new MethodNotAllowedHttpException(array('GET'));
     $exception->setHeaders($headers);
     $this->assertSame($headers, $exception->getHeaders());
 }
Ejemplo n.º 2
0
 public function whenNotAllowed(MethodNotAllowedHttpException $e)
 {
     $response = $this->createApiProblemResponse($e->getMessage(), Response::HTTP_METHOD_NOT_ALLOWED);
     $response->headers->add($e->getHeaders());
     return $response;
 }