/**
  * @test
  */
 public function renderCallsTheRightMethodsOnTheRootNode()
 {
     $renderingContext = $this->getMock('NamelessCoder\\Fluid\\Core\\Rendering\\RenderingContextInterface');
     $rootNode = $this->getMock('NamelessCoder\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
     $rootNode->expects($this->once())->method('evaluate')->with($renderingContext)->will($this->returnValue('T3DD09 Rock!'));
     $this->parsingState->setRootNode($rootNode);
     $renderedValue = $this->parsingState->render($renderingContext);
     $this->assertEquals($renderedValue, 'T3DD09 Rock!', 'The rendered value of the Root Node is not returned by the ParsingState.');
 }
示例#2
0
 /**
  * @return ParsingState
  */
 protected function getParsingState()
 {
     $rootNode = new RootNode();
     $state = new ParsingState();
     $state->setVariableProvider($this->variableProvider);
     $state->setViewHelperResolver($this->viewHelperResolver);
     $state->setRootNode($rootNode);
     $state->pushNodeToStack($rootNode);
     return $state;
 }