/** * @test */ public function viewHelperChildNodesCanBeReadAgain() { $viewHelperChildNodes = $this->createMock(\TYPO3\Fluid\Core\Parser\SyntaxTree\RootNode::class); $renderingContext = $this->createMock(\TYPO3\Fluid\Core\Rendering\RenderingContextInterface::class); $this->widgetContext->setViewHelperChildNodes($viewHelperChildNodes, $renderingContext); $this->assertSame($viewHelperChildNodes, $this->widgetContext->getViewHelperChildNodes()); $this->assertSame($renderingContext, $this->widgetContext->getViewHelperChildNodeRenderingContext()); }
/** * @test */ public function viewHelperChildNodesCanBeReadAgain() { $viewHelperChildNodes = $this->getMock('TYPO3\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode'); $renderingContext = $this->getMock('TYPO3\\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->create('TYPO3\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode'); foreach ($childNodes as $childNode) { $rootNode->addChildNode($childNode); } $this->widgetContext->setViewHelperChildNodes($rootNode, $this->renderingContext); }
/** * 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) { /** @var $rootNode RootNode */ $rootNode = $this->objectManager->get(\TYPO3\Fluid\Core\Parser\SyntaxTree\RootNode::class); foreach ($childNodes as $childNode) { $rootNode->addChildNode($childNode); } $this->widgetContext->setViewHelperChildNodes($rootNode, $this->renderingContext); }