/** * Render the parsed template with rendering context * * @param Tx_Fluid_Core_Rendering_RenderingContextInterface $renderingContext The rendering context to use * @return Rendered string */ public function render(Tx_Fluid_Core_Rendering_RenderingContextInterface $renderingContext) { return $this->rootNode->evaluate($renderingContext); }
/** * Render the parsed template with rendering context * * @param Tx_Fluid_Core_Rendering_RenderingContext $renderingContext The rendering context to use * @return Rendered string */ public function render(Tx_Fluid_Core_Rendering_RenderingContext $renderingContext) { $this->rootNode->setRenderingContext($renderingContext); return $this->rootNode->evaluate(); }
/** * @test * @author Sebastian Kurfürst <*****@*****.**> */ public function lessOrEqualsReturnFalseIfNumberIsBigger() { $rootNode = new Tx_Fluid_Core_Parser_SyntaxTree_RootNode(); $rootNode->addChildNode(new Tx_Fluid_Core_Parser_SyntaxTree_TextNode('11')); $rootNode->addChildNode(new Tx_Fluid_Core_Parser_SyntaxTree_TextNode('<=')); $rootNode->addChildNode(new Tx_Fluid_Core_Parser_SyntaxTree_TextNode('10')); $this->assertFalse($this->viewHelperNode->_call('evaluateBooleanExpression', $rootNode)); }
/** * @test * @author Sebastian Kurfürst <*****@*****.**> */ public function objectsAreComparedStrictlyInUnequalComparison() { $object1 = new stdClass(); $object2 = new stdClass(); $rootNode = new Tx_Fluid_Core_Parser_SyntaxTree_RootNode(); $object1Node = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', array('evaluate')); $object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1)); $object2Node = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_ObjectAccessorNode', array('evaluate')); $object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2)); $rootNode->addChildNode($object1Node); $rootNode->addChildNode(new Tx_Fluid_Core_Parser_SyntaxTree_TextNode('!=')); $rootNode->addChildNode($object2Node); $this->assertTrue($this->viewHelperNode->_call('evaluateBooleanExpression', $rootNode, $this->renderingContext)); }