Exemplo n.º 1
0
 /**
  * @param  resource   $stream
  * @param  Definition $definition
  * @param  mixed      $origin
  * @return mixed
  */
 public function decode($stream, Definition $definition, &$origin = null)
 {
     $context = new RootContext(new DefinitionContext($origin, $definition));
     $handler = new ContextHandler($context);
     $this->parser->parse($stream, $handler);
     return $context->fetch();
 }
Exemplo n.º 2
0
 public function testMelformedXmlException()
 {
     $this->setExpectedException('Exception');
     $handler = $this->getParserHandlerMock();
     $stream = $this->getDataStream("<root<</root>");
     $parser = new XmlParser();
     $parser->parse($stream, $handler);
 }