/** * @test * @author Sebastian Kurfürst <*****@*****.**> */ public function setChildNodesAddsChildNodesToWidgetContext() { $node1 = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode'); $node2 = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_TextNode', array(), array(), '', FALSE); $node3 = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_AbstractNode'); $rootNode = $this->getMock('Tx_Fluid_Core_Parser_SyntaxTree_RootNode'); $rootNode->expects($this->at(0))->method('addChildNode')->with($node1); $rootNode->expects($this->at(1))->method('addChildNode')->with($node2); $rootNode->expects($this->at(2))->method('addChildNode')->with($node3); $this->objectManager->expects($this->once())->method('create')->with('Tx_Fluid_Core_Parser_SyntaxTree_RootNode')->will($this->returnValue($rootNode)); $renderingContext = $this->getMock('Tx_Fluid_Core_Rendering_RenderingContextInterface'); $this->viewHelper->expects($this->once())->method('getRenderingContext')->will($this->returnValue($renderingContext)); $this->widgetContext->expects($this->once())->method('setViewHelperChildNodes')->with($rootNode, $renderingContext); $this->viewHelper->setChildNodes(array($node1, $node2, $node3)); }