/** * Initialize the Widget Context, before the Render method is called. * * @return void */ private function initializeWidgetContext() { $this->widgetContext->setWidgetConfiguration($this->getWidgetConfiguration()); $this->initializeWidgetIdentifier(); $this->widgetContext->setControllerObjectName(get_class($this->controller)); $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName(); $pluginName = $this->controllerContext->getRequest()->getPluginName(); $this->widgetContext->setParentExtensionName($extensionName); $this->widgetContext->setParentPluginName($pluginName); $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName); $this->widgetContext->setParentPluginNamespace($pluginNamespace); $this->widgetContext->setWidgetViewHelperClassName(get_class($this)); if ($this->ajaxWidget === true) { $this->ajaxWidgetContextHolder->store($this->widgetContext); } }
/** * @test */ public function widgetConfigurationCanBeReadAgain() { $this->widgetContext->setWidgetConfiguration(array('key' => 'value')); $this->assertEquals(array('key' => 'value'), $this->widgetContext->getWidgetConfiguration()); }