2 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
39 $this->controllerContext = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext::class, array(), array(),
'',
false);
40 $this->viewHelper = $this->getAccessibleMock(\TYPO3\CMS\
Fluid\ViewHelpers\RenderChildrenViewHelper::class, array(
'renderChildren'));
41 $this->viewHelper->_set(
'controllerContext', $this->controllerContext);
49 $this->request = $this->getMock(\TYPO3\CMS\
Fluid\Core\Widget\WidgetRequest::class);
50 $this->controllerContext->expects($this->any())->method(
'getRequest')->will($this->returnValue($this->request));
51 $this->viewHelper->initializeArguments();
59 $rootNode = $this->getMock(\TYPO3\CMS\
Fluid\Core\Parser\SyntaxTree\RootNode::class);
60 $widgetContext = $this->getMock(\TYPO3\CMS\
Fluid\Core\Widget\WidgetContext::class);
61 $this->request->expects($this->any())->method(
'getWidgetContext')->will($this->returnValue($widgetContext));
62 $widgetContext->expects($this->any())->method(
'getViewHelperChildNodeRenderingContext')->will($this->returnValue(
$renderingContext));
63 $widgetContext->expects($this->any())->method(
'getViewHelperChildNodes')->will($this->returnValue($rootNode));
64 $rootNode->expects($this->any())->method(
'evaluate')->with(
$renderingContext)->will($this->returnValue(
'Rendered Results'));
65 $output = $this->viewHelper->render(array(
'k1' =>
'v1',
'k2' =>
'v2'));
66 $this->assertEquals(
'Rendered Results', $output);
75 $this->request = $this->getMock(
'Tx_Fluid_MVC_Request');
76 $this->controllerContext->expects($this->any())->method(
'getRequest')->will($this->returnValue($this->request));
77 $this->viewHelper->initializeArguments();
78 $this->viewHelper->render();
87 $this->request = $this->getMock(\TYPO3\CMS\
Fluid\Core\Widget\WidgetRequest::class);
88 $this->controllerContext->expects($this->any())->method(
'getRequest')->will($this->returnValue($this->request));
89 $this->viewHelper->initializeArguments();
90 $widgetContext = $this->getMock(\TYPO3\CMS\
Fluid\Core\Widget\WidgetContext::class);
91 $this->request->expects($this->any())->method(
'getWidgetContext')->will($this->returnValue($widgetContext));
92 $widgetContext->expects($this->any())->method(
'getViewHelperChildNodeRenderingContext')->will($this->returnValue(null));
93 $widgetContext->expects($this->any())->method(
'getViewHelperChildNodes')->will($this->returnValue(null));
94 $this->viewHelper->render();