/** * @test * @author Sebastian Kurfürst <*****@*****.**> */ public function renderCallsTheRightMethodsOnTheRootNode() { $renderingContext = $this->getMock('F3\\Fluid\\Core\\Rendering\\RenderingContext'); $rootNode = $this->getMock('F3\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode'); $rootNode->expects($this->once())->method('setRenderingContext')->with($renderingContext); $rootNode->expects($this->once())->method('evaluate')->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.'); }
/** * Text node handler * * @param \F3\Fluid\Core\Parser\ParsingState $state * @param string $text * @return void * @author Sebastian Kurfürst <*****@*****.**> * @author Karsten Dambekalns <*****@*****.**> */ protected function textHandler(\F3\Fluid\Core\Parser\ParsingState $state, $text) { $node = $this->objectFactory->create('F3\\Fluid\\Core\\Parser\\SyntaxTree\\TextNode', $text); if ($this->configuration !== NULL) { foreach ($this->configuration->getTextInterceptors() as $interceptor) { $node = $interceptor->process($node); } } $state->getNodeFromStack()->addChildNode($node); }