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