/** * @test */ public function processRequestShouldSetWidgetConfiguration() { $request = new \TYPO3\Flow\Mvc\ActionRequest(new \TYPO3\Flow\Mvc\ActionRequest(\TYPO3\Flow\Http\Request::create(new \TYPO3\Flow\Http\Uri('http://localhost/foo')))); $response = new \TYPO3\Flow\Http\Response(); $widgetContext = $this->getMock('TYPO3\\Fluid\\Core\\Widget\\WidgetContext', array('getWidgetConfiguration')); $widgetContext->expects($this->once())->method('getWidgetConfiguration')->will($this->returnValue('myConfiguration')); $request->setArgument('__widgetContext', $widgetContext); $abstractWidgetController = $this->getAccessibleMock('TYPO3\\Fluid\\Core\\Widget\\AbstractWidgetController', array('resolveActionMethodName', 'initializeActionMethodArguments', 'initializeActionMethodValidators', 'mapRequestArgumentsToControllerArguments', 'detectFormat', 'resolveView', 'callActionMethod')); $abstractWidgetController->_set('argumentsMappingResults', new \TYPO3\Flow\Error\Result()); $abstractWidgetController->_set('flashMessageContainer', new \TYPO3\Flow\Mvc\FlashMessageContainer()); $abstractWidgetController->_set('mvcPropertyMappingConfigurationService', $this->getMock('TYPO3\\Flow\\Mvc\\Controller\\MvcPropertyMappingConfigurationService')); $abstractWidgetController->processRequest($request, $response); $widgetConfiguration = $abstractWidgetController->_get('widgetConfiguration'); $this->assertEquals('myConfiguration', $widgetConfiguration); }