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 testRootNodeNameMismatchException()
 {
     $this->setExpectedException('Exception');
     $context = $this->getParserContextMock();
     $root = new RootContext($context, 'root');
     $root->start('document');
 }