/**
  * Calls the ViewHelper, and emulates a rendering.
  *
  * @return void
  */
 public function callViewHelper()
 {
     $viewHelperVariableContainer = $this->getMock(\TYPO3\Fluid\Core\ViewHelper\ViewHelperVariableContainer::class);
     $renderingContext = new \TYPO3\Fluid\Core\Rendering\RenderingContext();
     $renderingContext->injectViewHelperVariableContainer($viewHelperVariableContainer);
     $this->viewHelper->setRenderingContext($renderingContext);
     $this->viewHelper->expects($this->any())->method('getWidgetConfiguration')->will($this->returnValue(array('Some Widget Configuration')));
     $this->widgetContext->expects($this->once())->method('setNonAjaxWidgetConfiguration')->with(array('Some Widget Configuration'));
     $this->widgetContext->expects($this->once())->method('setWidgetIdentifier')->with(strtolower(str_replace('\\', '-', get_class($this->viewHelper))));
     $this->viewHelper->_set('controller', new \stdClass());
     $this->widgetContext->expects($this->once())->method('setControllerObjectName')->with('stdClass');
     $this->viewHelper->expects($this->once())->method('validateArguments');
     $this->viewHelper->expects($this->once())->method('initialize');
     $this->viewHelper->expects($this->once())->method('callRenderMethod')->will($this->returnValue('renderedResult'));
     $output = $this->viewHelper->initializeArgumentsAndRender(array('arg1' => 'val1'));
     $this->assertEquals('renderedResult', $output);
 }
 /**
  * Calls the ViewHelper, and emulates a rendering.
  *
  * @return void
  */
 public function callViewHelper()
 {
     $mockViewHelperVariableContainer = $this->getMock('TYPO3\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
     $mockRenderingContext = $this->getMock('TYPO3\\Fluid\\Core\\Rendering\\RenderingContextInterface');
     $mockRenderingContext->expects($this->atLeastOnce())->method('getViewHelperVariableContainer')->will($this->returnValue($mockViewHelperVariableContainer));
     $this->viewHelper->setRenderingContext($mockRenderingContext);
     $this->viewHelper->expects($this->once())->method('getWidgetConfiguration')->will($this->returnValue('Some Widget Configuration'));
     $this->widgetContext->expects($this->once())->method('setWidgetConfiguration')->with('Some Widget Configuration');
     $this->widgetContext->expects($this->once())->method('setWidgetIdentifier')->with('@widget_0');
     $this->viewHelper->_set('controller', new \stdClass());
     $this->widgetContext->expects($this->once())->method('setControllerObjectName')->with('stdClass');
     $this->viewHelper->expects($this->once())->method('validateArguments');
     $this->viewHelper->expects($this->once())->method('initialize');
     $this->viewHelper->expects($this->once())->method('callRenderMethod')->will($this->returnValue('renderedResult'));
     $output = $this->viewHelper->initializeArgumentsAndRender();
     $this->assertEquals('renderedResult', $output);
 }