55 $this->widgetRequestBuilder = $this->
getAccessibleMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequestBuilder', array(
'setArgumentsFromRawRequestData'));
56 $this->mockWidgetRequest = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest');
57 $this->mockObjectManager = $this->getMock(
'TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
58 $this->mockObjectManager->expects($this->once())->method(
'get')->with(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest')->will($this->returnValue($this->mockWidgetRequest));
59 $this->widgetRequestBuilder->_set(
'objectManager', $this->mockObjectManager);
60 $this->mockWidgetContext = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
61 $this->mockAjaxWidgetContextHolder = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Widget\\AjaxWidgetContextHolder', array(), array(),
'', FALSE);
62 $this->widgetRequestBuilder->injectAjaxWidgetContextHolder($this->mockAjaxWidgetContextHolder);
63 $this->mockAjaxWidgetContextHolder->expects($this->once())->method(
'get')->will($this->returnValue($this->mockWidgetContext));
71 $this->mockWidgetRequest->expects($this->once())->method(
'setRequestURI')->with($requestUri);
72 $this->widgetRequestBuilder->build();
80 $this->mockWidgetRequest->expects($this->once())->method(
'setBaseURI')->with($baseUri);
81 $this->widgetRequestBuilder->build();
88 $_SERVER[
'REQUEST_METHOD'] =
'POST';
89 $this->mockWidgetRequest->expects($this->once())->method(
'setMethod')->with(
'POST');
90 $this->widgetRequestBuilder->build();
97 $_SERVER[
'REQUEST_METHOD'] =
'POST';
98 $_GET = array(
'get' =>
'foo');
99 $_POST = array(
'post' =>
'bar');
100 $this->mockWidgetRequest->expects($this->once())->method(
'setArguments')->with($_POST);
101 $this->widgetRequestBuilder->build();
108 $_SERVER[
'REQUEST_METHOD'] =
'GET';
109 $_GET = array(
'get' =>
'foo');
110 $_POST = array(
'post' =>
'bar');
111 $this->mockWidgetRequest->expects($this->once())->method(
'setArguments')->with($_GET);
112 $this->widgetRequestBuilder->build();
119 $_GET = array(
'action' =>
'myAction');
120 $this->mockWidgetRequest->expects($this->once())->method(
'setControllerActionName')->with(
'myAction');
121 $this->widgetRequestBuilder->build();
128 $_GET = array(
'fluid-widget-id' =>
'123');
129 $this->mockAjaxWidgetContextHolder->expects($this->once())->method(
'get')->with(
'123')->will($this->returnValue($this->mockWidgetContext));
130 $this->mockWidgetRequest->expects($this->once())->method(
'setWidgetContext')->with($this->mockWidgetContext);
131 $this->widgetRequestBuilder->build();
139 $actual = $this->widgetRequestBuilder->build();
140 $this->assertSame($expected, $actual);
static getIndpEnv($getEnvName)
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)