See also: https://tools.ietf.org/html/rfc7807
Author: Kévin Dunglas (dunglas@gmail.com)
Inheritance: implements Symfony\Component\Serializer\Normalizer\NormalizerInterface
Esempio n. 1
0
 public function testNormalize()
 {
     $normalizer = new ErrorNormalizer();
     $this->assertEquals(['type' => 'https://tools.ietf.org/html/rfc2616#section-10', 'title' => 'An error occurred', 'detail' => 'Hello'], $normalizer->normalize(new \Exception('Hello')));
     $this->assertEquals(['type' => 'https://dunglas.fr', 'title' => 'Hi', 'detail' => 'Hello'], $normalizer->normalize(new \Exception('Hello'), null, ['type' => 'https://dunglas.fr', 'title' => 'Hi']));
 }