public function testNormalizeNull()
 {
     $definition = $this->getDefinitionMock();
     $definition->expects($this->once())->method('isObject')->will($this->returnValue(true));
     $definition->expects($this->once())->method('extract')->will($this->returnValue(null));
     $normalizer = new Normalizer();
     $this->assertNull($normalizer->normalize(null, $definition));
 }
Example #2
0
 /**
  * @param mixed      $origin
  * @param Definition $definition
  * @param resource   $stream
  */
 public function encode($origin, Definition $definition, $stream)
 {
     $normalized = $this->normalizer->normalize($origin, $definition);
     $content = json_encode($normalized, $this->options);
     fwrite($stream, $content);
 }