/** * @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(); }
public function testMelformedXmlException() { $this->setExpectedException('Exception'); $handler = $this->getParserHandlerMock(); $stream = $this->getDataStream("<root<</root>"); $parser = new XmlParser(); $parser->parse($stream, $handler); }