/** * @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)); }
/** * Helper method which triggers the rendering of everything between the * opening and the closing tag. * * @return mixed The finally rendered child nodes. * @author Sebastian Kurfürst <*****@*****.**> * @author Bastian Waidelich <*****@*****.**> * @api */ protected function renderChildren() { return $this->viewHelperNode->evaluateChildNodes(); }
/** * @test * @author Sebastian Kurfürst <*****@*****.**> */ public function multipleEvaluateCallsShareTheSameViewHelperInstance() { $mockViewHelper = $this->getMock('Tx_Fluid_Core_ViewHelper_AbstractViewHelper', array('render', 'validateArguments', 'prepareArguments', 'setViewHelperVariableContainer')); $mockViewHelper->expects($this->any())->method('render')->will($this->returnValue('String')); $viewHelperNode = new Tx_Fluid_Core_Parser_SyntaxTree_ViewHelperNode($mockViewHelper, array()); $mockViewHelperArguments = $this->getMock('Tx_Fluid_Core_ViewHelper_Arguments', array(), array(), '', FALSE); $this->mockObjectManager->expects($this->at(0))->method('create')->with('Tx_Fluid_Core_ViewHelper_Arguments')->will($this->returnValue($mockViewHelperArguments)); $this->mockObjectManager->expects($this->at(1))->method('create')->with('Tx_Fluid_Core_ViewHelper_Arguments')->will($this->returnValue($mockViewHelperArguments)); $viewHelperNode->evaluate($this->renderingContext); $viewHelperNode->evaluate($this->renderingContext); }