33 $request = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array(
'dummy'), array(),
'', FALSE);
34 $abstractWidgetController = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array(
'dummy'), array(),
'', FALSE);
35 $this->assertTrue($abstractWidgetController->canProcessRequest($request));
42 $widgetContext = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
43 $widgetContext->expects($this->once())->method(
'getWidgetConfiguration')->will($this->returnValue(
'myConfiguration'));
44 $request = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array(), array(),
'', FALSE);
45 $request->expects($this->once())->method(
'getWidgetContext')->will($this->returnValue($widgetContext));
46 $response = $this->getMock(
'TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface');
47 $abstractWidgetController = $this->
getAccessibleMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array(
'resolveActionMethodName',
'initializeActionMethodArguments',
'initializeActionMethodValidators',
'initializeAction',
'checkRequestHash',
'mapRequestArgumentsToControllerArguments',
'buildControllerContext',
'resolveView',
'callActionMethod'), array(),
'', FALSE);
48 $mockUriBuilder = $this->getMock(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
49 $objectManager = $this->getMock(
'TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
50 $objectManager->expects($this->any())->method(
'get')->with(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder')->will($this->returnValue($mockUriBuilder));
52 $configurationService = $this->getMock(
'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfigurationService');
53 $abstractWidgetController->_set(
'mvcPropertyMappingConfigurationService', $configurationService);
54 $abstractWidgetController->_set(
'arguments',
new \
TYPO3\CMS\Extbase\Mvc\Controller\Arguments());
56 $abstractWidgetController->_set(
'objectManager', $objectManager);
57 $abstractWidgetController->processRequest($request, $response);
58 $widgetConfiguration = $abstractWidgetController->_get(
'widgetConfiguration');
59 $this->assertEquals(
'myConfiguration', $widgetConfiguration);
66 $frameworkConfiguration = array(
69 'TYPO3\\CMS\\Fluid\\ViewHelpers\\Widget\\PaginateViewHelper' => array(
70 'templateRootPath' =>
'EXT:fluid/Resources/Private/DummyTestTemplates' 75 $widgetContext = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
76 $widgetContext->expects($this->any())->method(
'getWidgetViewHelperClassName')->will($this->returnValue(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\Widget\\PaginateViewHelper'));
77 $request = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array(), array(),
'', FALSE);
78 $request->expects($this->any())->method(
'getWidgetContext')->will($this->returnValue($widgetContext));
79 $configurationManager = $this->getMock(
'TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
80 $configurationManager->expects($this->any())->method(
'getConfiguration')->will($this->returnValue($frameworkConfiguration));
81 $view = $this->
getAccessibleMock(
'TYPO3\\CMS\\Fluid\\View\\TemplateView', array(
'dummy'), array(),
'', FALSE);
82 $abstractWidgetController = $this->
getAccessibleMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array(
'dummy'));
83 $abstractWidgetController->_set(
'configurationManager', $configurationManager);
84 $abstractWidgetController->_set(
'request', $request);
85 $abstractWidgetController->_call(
'setViewConfiguration', $view);
86 $this->assertEquals(\
TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName(
'EXT:fluid/Resources/Private/DummyTestTemplates'), $view->_call(
'getTemplateRootPath'));
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)