setAjaxWidgetConfiguration() public method

public setAjaxWidgetConfiguration ( array $ajaxWidgetConfiguration ) : void
$ajaxWidgetConfiguration array
return void
 /**
  * @test
  */
 public function aWidgetConfigurationIsReturnedWhenContextIsSerialized()
 {
     $this->widgetContext->setNonAjaxWidgetConfiguration(array('key' => 'value'));
     $this->widgetContext->setAjaxWidgetConfiguration(array('keyAjax' => 'valueAjax'));
     $this->widgetContext = serialize($this->widgetContext);
     $this->widgetContext = unserialize($this->widgetContext);
     $this->assertEquals(array('keyAjax' => 'valueAjax'), $this->widgetContext->getWidgetConfiguration());
 }
 /**
  * Initialize the Widget Context, before the Render method is called.
  *
  * @return void
  */
 private function initializeWidgetContext()
 {
     if ($this->ajaxWidget === true) {
         if ($this->storeConfigurationInSession === true) {
             $this->ajaxWidgetContextHolder->store($this->widgetContext);
         }
         $this->widgetContext->setAjaxWidgetConfiguration($this->getAjaxWidgetConfiguration());
     }
     $this->widgetContext->setNonAjaxWidgetConfiguration($this->getNonAjaxWidgetConfiguration());
     $this->initializeWidgetIdentifier();
     $controllerObjectName = $this->controller instanceof DependencyProxy ? $this->controller->_getClassName() : get_class($this->controller);
     $this->widgetContext->setControllerObjectName($controllerObjectName);
 }
 /**
  * @test
  */
 public function processRequestShouldSetWidgetConfiguration()
 {
     /** @var \Neos\Flow\Mvc\ActionRequest $mockActionRequest */
     $mockActionRequest = $this->createMock(\Neos\Flow\Mvc\ActionRequest::class);
     $mockResponse = $this->createMock(\Neos\Flow\Http\Response::class);
     $httpRequest = Request::create(new Uri('http://localhost'));
     $mockActionRequest->expects($this->any())->method('getHttpRequest')->will($this->returnValue($httpRequest));
     $expectedWidgetConfiguration = array('foo' => uniqid());
     $widgetContext = new WidgetContext();
     $widgetContext->setAjaxWidgetConfiguration($expectedWidgetConfiguration);
     $mockActionRequest->expects($this->atLeastOnce())->method('getInternalArgument')->with('__widgetContext')->will($this->returnValue($widgetContext));
     $abstractWidgetController = $this->getAccessibleMock(\Neos\FluidAdaptor\Core\Widget\AbstractWidgetController::class, array('resolveActionMethodName', 'initializeActionMethodArguments', 'initializeActionMethodValidators', 'mapRequestArgumentsToControllerArguments', 'detectFormat', 'resolveView', 'callActionMethod'));
     $abstractWidgetController->_set('mvcPropertyMappingConfigurationService', $this->createMock(\Neos\Flow\Mvc\Controller\MvcPropertyMappingConfigurationService::class));
     $abstractWidgetController->processRequest($mockActionRequest, $mockResponse);
     $actualWidgetConfiguration = $abstractWidgetController->_get('widgetConfiguration');
     $this->assertEquals($expectedWidgetConfiguration, $actualWidgetConfiguration);
 }