コード例 #1
0
 /**
  * @test
  */
 public function buildSetsWidgetContext()
 {
     $_GET = array('fluid-widget-id' => '123');
     $this->mockAjaxWidgetContextHolder->expects($this->once())->method('get')->with('123')->will($this->returnValue($this->mockWidgetContext));
     $this->mockWidgetRequest->expects($this->once())->method('setWidgetContext')->with($this->mockWidgetContext);
     $this->widgetRequestBuilder->build();
 }
コード例 #2
0
 /**
  * Pass the arguments of the widget to the subrequest.
  *
  * @param \TYPO3\Fluid\Core\Widget\WidgetRequest $subRequest
  * @return void
  */
 private function passArgumentsToSubRequest(\TYPO3\Fluid\Core\Widget\WidgetRequest $subRequest)
 {
     $arguments = $this->controllerContext->getRequest()->getArguments();
     $widgetIdentifier = $this->widgetContext->getWidgetIdentifier();
     if (isset($arguments[$widgetIdentifier])) {
         if (isset($arguments[$widgetIdentifier]['action'])) {
             $subRequest->setControllerActionName($arguments[$widgetIdentifier]['action']);
             unset($arguments[$widgetIdentifier]['action']);
         }
         $subRequest->setArguments($arguments[$widgetIdentifier]);
     }
 }