/** * @test */ public function viewHelperChildNodesCanBeReadAgain() { $viewHelperChildNodes = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode'); $renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface'); $this->widgetContext->setViewHelperChildNodes($viewHelperChildNodes, $renderingContext); $this->assertSame($viewHelperChildNodes, $this->widgetContext->getViewHelperChildNodes()); $this->assertSame($renderingContext, $this->widgetContext->getViewHelperChildNodeRenderingContext()); }
/** * Stores the syntax tree child nodes in the Widget Context, so they can be * rendered with <f:widget.renderChildren> lateron. * * @param array $childNodes The SyntaxTree Child nodes of this ViewHelper. * @return void */ public function setChildNodes(array $childNodes) { $rootNode = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class); foreach ($childNodes as $childNode) { $rootNode->addChildNode($childNode); } $this->widgetContext->setViewHelperChildNodes($rootNode, $this->renderingContext); }