/** * @test */ public function cachingOfActionsCanNotBeChanged() { $configuration = array('extensionName' => 'CurrentExtensionName', 'pluginName' => 'CurrentPluginName', 'switchableControllerActions' => array('Controller1' => array('newAction', 'action1'), 'Controller2' => array('newAction2', 'action4', 'action5'))); $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration)); $this->abstractConfigurationManager->setConfiguration($configuration); $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration)); $this->abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testSwitchableControllerActions)); $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnCallBack(create_function('$a', 'return $a;'))); $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration(); $expectedResult = array('Controller1' => array('actions' => array('newAction', 'action1')), 'Controller2' => array('actions' => array('newAction2', 'action4', 'action5'), 'nonCacheableActions' => array('action4'))); $actualResult = $mergedConfiguration['controllerConfiguration']; $this->assertEquals($expectedResult, $actualResult); }
/** * Returns the specified configuration. * The actual configuration will be merged from different sources in a defined order. * * You can get the following types of configuration invoking: * CONFIGURATION_TYPE_SETTINGS: Extbase settings * CONFIGURATION_TYPE_FRAMEWORK: the current module/plugin settings * CONFIGURATION_TYPE_FULL_TYPOSCRIPT: a raw TS array * * Note that this is a low level method and only makes sense to be used by Extbase internally. * * @param string $configurationType The kind of configuration to fetch - must be one of the CONFIGURATION_TYPE_* constants * @param string $extensionName if specified, the configuration for the given extension will be returned. * @param string $pluginName if specified, the configuration for the given plugin will be returned. * @throws Exception\InvalidConfigurationTypeException * @return array The configuration */ public function getConfiguration($configurationType, $extensionName = NULL, $pluginName = NULL) { switch ($configurationType) { case self::CONFIGURATION_TYPE_SETTINGS: $configuration = $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName); return $configuration['settings']; case self::CONFIGURATION_TYPE_FRAMEWORK: return $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName); case self::CONFIGURATION_TYPE_FULL_TYPOSCRIPT: return $this->concreteConfigurationManager->getTypoScriptSetup(); default: throw new \TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException('Invalid configuration type "' . $configurationType . '"', 1206031879); } }