/** * @test */ public function setChildNodesAddsChildNodesToWidgetContext() { $node1 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class); $node2 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::class, array(), array(), '', FALSE); $node3 = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class); $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class); $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('get')->with(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class)->will($this->returnValue($rootNode)); $renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class); $this->viewHelper->_set('renderingContext', $renderingContext); $this->widgetContext->expects($this->once())->method('setViewHelperChildNodes')->with($rootNode, $renderingContext); $this->viewHelper->setChildNodes(array($node1, $node2, $node3)); }