normalize() public method

public normalize ( $object, $format = null, array $context = [] )
$context array
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']));
 }