コード例 #1
0
ファイル: ParsingStateTest.php プロジェクト: bwaidelich/Fluid
 /**
  * @test
  */
 public function renderCallsTheRightMethodsOnTheRootNode()
 {
     $renderingContext = $this->getMock('TYPO3Fluid\\Fluid\\Core\\Rendering\\RenderingContextInterface');
     $rootNode = $this->getMock('TYPO3Fluid\\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
ファイル: ParsingStateTest.php プロジェクト: mbrodala/Fluid
 /**
  * @test
  */
 public function renderCallsTheRightMethodsOnTheRootNode()
 {
     $renderingContext = new RenderingContextFixture();
     $rootNode = $this->getMock(RootNode::class);
     $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.');
 }
コード例 #3
0
ファイル: TemplateParser.php プロジェクト: mbrodala/Fluid
 /**
  * @return ParsingState
  */
 protected function getParsingState()
 {
     $rootNode = new RootNode();
     $variableProvider = $this->renderingContext->getVariableProvider();
     $state = new ParsingState();
     $state->setRootNode($rootNode);
     $state->pushNodeToStack($rootNode);
     $state->setVariableProvider($variableProvider->getScopeCopy($variableProvider->getAll()));
     return $state;
 }
コード例 #4
0
ファイル: TemplateParser.php プロジェクト: bwaidelich/Fluid
 /**
  * @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;
 }