Neos\FluidAdaptor\Tests\Unit\Core\Widget\AbstractWidgetViewHelperTest::callViewHelper PHP Method

callViewHelper() public method

Calls the ViewHelper, and emulates a rendering.
public callViewHelper ( ) : void
return void
    public function callViewHelper()
    {
        $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);
    }