[!!!][+BUGFIX] Extbase: Fix Extbase Caching Bug (thanks to Bastian Waidelich)
authorJochen Rau <j.rau@web.de>
Mon, 20 Sep 2010 13:48:47 +0000 (13:48 +0000)
committerJochen Rau <j.rau@web.de>
Mon, 20 Sep 2010 13:48:47 +0000 (13:48 +0000)
Non-cacheable actions were cached due to the fact that TYPO3s
TypoScript condition "GP" does not merge GET & POST vars.
Additionally "switchableControllerActions" that were overridden
in the plugin flexform were not taken into account.
This is a breaking change if you set up your TS configuration
of the plugin manually.

typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php
typo3/sysext/extbase/Classes/Dispatcher.php
typo3/sysext/extbase/Classes/MVC/Web/RequestBuilder.php
typo3/sysext/extbase/Classes/Utility/Extension.php
typo3/sysext/extbase/Tests/Configuration/FrontendConfigurationManager_testcase.php
typo3/sysext/extbase/Tests/MVC/Web/RequestBuilder_testcase.php
typo3/sysext/extbase/Tests/Utility/Extension_testcase.php

index 68e42f7..ad03677 100644 (file)
@@ -216,13 +216,19 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
                        }
 
                        if (count($newSwitchableControllerActionsFromFlexform)) {
-                               $frameworkConfiguration['switchableControllerActions'] = array();
+                               $overriddenSwitchableControllerActions = array();
                                foreach ($newSwitchableControllerActionsFromFlexform as $controller => $actions) {
-                                       $frameworkConfiguration['switchableControllerActions'][] = array(
+                                       $overriddenSwitchableControllerActions[$controller] = array(
                                                'controller' => $controller,
                                                'actions' => implode(',', $actions)
                                        );
+                                       $nonCacheableActions = t3lib_div::trimExplode(',', $frameworkConfiguration['switchableControllerActions'][$controller]['nonCacheableActions']);
+                                       $overriddenNonCacheableActions = array_intersect($nonCacheableActions, $actions);
+                                       if (!empty($overriddenNonCacheableActions)) {
+                                               $overriddenSwitchableControllerActions[$controller]['nonCacheableActions'] = implode(',', $overriddenNonCacheableActions);
+                                       }
                                }
+                               $frameworkConfiguration['switchableControllerActions'] = $overriddenSwitchableControllerActions;
 
                                // We want the first controller/action be the default.
                                unset($frameworkConfiguration['controller']);
@@ -232,4 +238,4 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
                return $frameworkConfiguration;
        }
 }
-?>
\ No newline at end of file
+?>
index 27b6930..226edae 100644 (file)
@@ -103,7 +103,7 @@ class Tx_Extbase_Dispatcher {
                        t3lib_div::sysLog('Extbase was not able to dispatch the request. No configuration.', 'extbase', t3lib_div::SYSLOG_SEVERITY_ERROR);
                        return $content;
                }
-               
+
                $this->initializeConfigurationManagerAndFrameworkConfiguration($configuration);
 
                $requestBuilder = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_RequestBuilder');
@@ -112,7 +112,16 @@ class Tx_Extbase_Dispatcher {
                if (isset($this->cObj->data) && is_array($this->cObj->data)) {
                        // we need to check the above conditions as cObj is not available in Backend.
                        $request->setContentObjectData($this->cObj->data);
-                       $request->setIsCached($this->cObj->getUserObjectType() == tslib_cObj::OBJECTTYPE_USER);
+                       if ($this->isCacheable($request->getControllerName(), $request->getControllerActionName())) {
+                               $request->setIsCached(TRUE);
+                       } else {
+                               if ($this->cObj->getUserObjectType() === tslib_cObj::OBJECTTYPE_USER) {
+                                       $this->cObj->convertToUserIntObject();
+                                       // tslib_cObj::convertToUserIntObject() will recreate the object, so we have to stop the request here
+                                       return;
+                               }
+                               $request->setIsCached(FALSE);
+                       }
                }
                $response = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Response');
 
@@ -143,7 +152,7 @@ class Tx_Extbase_Dispatcher {
                $this->timeTrackPull();
 
                self::$reflectionService->shutdown();
-               
+
                if (count($response->getAdditionalHeaderData()) > 0) {
                        $GLOBALS['TSFE']->additionalHeaderData[$request->getControllerExtensionName()] = implode("\n", $response->getAdditionalHeaderData());
                }
@@ -153,6 +162,21 @@ class Tx_Extbase_Dispatcher {
        }
 
        /**
+        * Determines whether the current action can be cached
+        *
+        * @param string $controllerName
+        * @param string $actionName
+        * @return boolean TRUE if the given action should be cached, otherwise FALSE
+        */
+       protected function isCacheable($controllerName, $actionName) {
+               if (isset(self::$extbaseFrameworkConfiguration['switchableControllerActions'][$controllerName]['nonCacheableActions'])
+                       && in_array($actionName, t3lib_div::trimExplode(',', self::$extbaseFrameworkConfiguration['switchableControllerActions'][$controllerName]['nonCacheableActions']))) {
+                               return FALSE;
+               }
+               return TRUE;
+       }
+
+       /**
         * Initializes the autoload mechanism of Extbase. This is supplement to the core autoloader.
         *
         * @return void
@@ -229,7 +253,7 @@ class Tx_Extbase_Dispatcher {
                $propertyMapper = t3lib_div::makeInstance('Tx_Extbase_Property_Mapper');
                $propertyMapper->injectReflectionService(self::$reflectionService);
                $controller->injectPropertyMapper($propertyMapper);
-               
+
                $controller->injectSettings(is_array(self::$extbaseFrameworkConfiguration['settings']) ? self::$extbaseFrameworkConfiguration['settings'] : array());
 
                $flashMessageContainer = t3lib_div::makeInstance('Tx_Extbase_MVC_Controller_FlashMessages'); // singleton
@@ -264,12 +288,12 @@ class Tx_Extbase_Dispatcher {
                        $dataMapper->injectSession($persistenceSession);
                        $dataMapper->injectReflectionService(self::$reflectionService);
                        $dataMapper->injectDataMapFactory($dataMapFactory);
-                       
+
                        $storageBackend = t3lib_div::makeInstance('Tx_Extbase_Persistence_Storage_Typo3DbBackend', $GLOBALS['TYPO3_DB']); // singleton
                        $storageBackend->injectDataMapper($dataMapper);
 
                        $qomFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_QueryObjectModelFactory', $storageBackend);
-                       
+
                        $dataMapper->setQomFactory($qomFactory);
 
                        $persistenceBackend = t3lib_div::makeInstance('Tx_Extbase_Persistence_Backend', $persistenceSession, $storageBackend); // singleton
@@ -506,10 +530,11 @@ class Tx_Extbase_Dispatcher {
                        if ($i == 1) {
                                $actions .= ',extObj';
                        }
-                       $extbaseConfiguration['switchableControllerActions.'][$i++ . '.'] = array(
+                       $extbaseConfiguration['switchableControllerActions.'][$controller . '.'] = array(
                                'controller' => $controller,
                                'actions' => $actions,
                        );
+                       $i++;
                }
 
                        // BACK_PATH is the path from the typo3/ directory from within the
index af72757..e0152af 100644 (file)
@@ -92,10 +92,10 @@ class Tx_Extbase_MVC_Web_RequestBuilder {
                }
                $allowedControllerActions = array();
                if (is_array($configuration['switchableControllerActions'])) {
-                       foreach ($configuration['switchableControllerActions'] as $controllerConfiguration) {
-                               $controllerActions = t3lib_div::trimExplode(',', $controllerConfiguration['actions']);
+                       foreach ($configuration['switchableControllerActions'] as $controller => $controllerConfiguration) {
+                               $controllerActions = t3lib_div::trimExplode(',', $controllerConfiguration['actions'], TRUE);
                                foreach ($controllerActions as $actionName) {
-                                       $allowedControllerActions[$controllerConfiguration['controller']][] = $actionName;
+                                       $allowedControllerActions[$controller][] = $actionName;
                                }
                        }
                }
@@ -121,8 +121,8 @@ class Tx_Extbase_MVC_Web_RequestBuilder {
                } else {
                        $controllerName = $this->defaultControllerName;
                        $actionName = $this->defaultActionName;
-               }                               
-               
+               }
+
                $request = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Request');
                $request->setPluginName($this->pluginName);
                $request->setControllerExtensionName($this->extensionName);
@@ -135,7 +135,7 @@ class Tx_Extbase_MVC_Web_RequestBuilder {
                if (is_string($parameters['format']) && (strlen($parameters['format']))) {
                        $request->setFormat(filter_var($parameters['format'], FILTER_SANITIZE_STRING));
                }
-               
+
                foreach ($parameters as $argumentName => $argumentValue) {
                        $request->setArgument($argumentName, $argumentValue);
                }
index 75ddec6..c4090b5 100644 (file)
@@ -47,11 +47,11 @@ class Tx_Extbase_Utility_Extension {
         * @param string $extensionName The extension name (in UpperCamelCase) or the extension key (in lower_underscore)
         * @param string $pluginName must be a unique id for your plugin in UpperCamelCase (the string length of the extension key added to the length of the plugin name should be less than 32!)
         * @param string $controllerActions is an array of allowed combinations of controller and action stored in an array (controller name as key and a comma separated list of action names as value, the first controller and its first action is chosen as default)
-        * @param string $nonCachableControllerActions is an optional array of controller name and  action names which should not be cached (array as defined in $controllerActions)
+        * @param string $nonCacheableControllerActions is an optional array of controller name and  action names which should not be cached (array as defined in $controllerActions)
         * @param string $defaultControllerAction is an optional array controller name (as array key) and action name (as array value) that should be called as default
         * @return void
         */
-       public static function configurePlugin($extensionName, $pluginName, array $controllerActions, array $nonCachableControllerActions = array()) {
+       public static function configurePlugin($extensionName, $pluginName, array $controllerActions, array $nonCacheableControllerActions = array()) {
                if (empty($pluginName)) {
                        throw new InvalidArgumentException('The plugin name must not be empty', 1239891987);
                }
@@ -61,25 +61,19 @@ class Tx_Extbase_Utility_Extension {
                $extensionName = str_replace(' ', '', ucwords(str_replace('_', ' ', $extensionName)));
                $pluginSignature = strtolower($extensionName) . '_' . strtolower($pluginName);
 
-               $controllerCounter = 1;
-               $hasMultipleActionsCounter = 0;
                $controllers = '';
                foreach ($controllerActions as $controller => $actionsList) {
                        $controllers .= '
-               ' . $controllerCounter . '.controller = ' . $controller . '
-               ' . $controllerCounter . '.actions = ' . $actionsList;
-                       $controllerCounter++;
-                       if (strpos($actionsList, ',') !== FALSE) {
-                               $hasMultipleActionsCounter++;
+               ' . $controller . '.actions = ' . $actionsList;
+                       if (!empty($nonCacheableControllerActions[$controller])) {
+                               $controllers .= '
+               ' . $controller . '.nonCacheableActions = ' . $nonCacheableControllerActions[$controller];
                        }
                }
 
-               $switchableControllerActions = '';
-               if ($controllerCounter > 1 || $hasMultipleActionsCounter > 0) {
-                               $switchableControllerActions = '
+               $switchableControllerActions = '
        switchableControllerActions {' . $controllers . '
        }';
-               }
 
                reset($controllerActions);
                $defaultController = key($controllerActions);
@@ -89,31 +83,6 @@ class Tx_Extbase_Utility_Extension {
                $action = '
        action = ' . $defaultAction;
 
-               $nonCachableActions = array();
-               if (!empty($nonCachableControllerActions[$defaultController])) {
-                       $nonCachableActions = t3lib_div::trimExplode(',', $nonCachableControllerActions[$defaultController]);
-               }
-               $cachableActions = array_diff(t3lib_div::trimExplode(',', $controllerActions[$defaultController]), $nonCachableActions);
-
-               $contentObjectType = in_array($defaultAction, $nonCachableActions) ? 'USER_INT' : 'USER';
-
-               $conditions = '';
-               foreach ($controllerActions as $controllerName => $actionsList) {
-                       if (!empty($nonCachableControllerActions[$controllerName])) {
-                               $nonCachableActions = t3lib_div::trimExplode(',', $nonCachableControllerActions[$controllerName]);
-                               $cachableActions = array_diff(t3lib_div::trimExplode(',', $controllerActions[$controllerName]), $nonCachableActions);
-                               if (($contentObjectType == 'USER' && count($nonCachableActions) > 0)
-                                       || ($contentObjectType == 'USER_INT' && count($cachableActions) > 0)) {
-
-                                       $conditions .= '
-[globalString = GP:tx_' . $pluginSignature . '|controller = ' . $controllerName . '] && [globalString = GP:tx_' . $pluginSignature . '|action = /' . implode('|', $contentObjectType === 'USER' ? $nonCachableActions : $cachableActions) . '/]
-tt_content.list.20.' . $pluginSignature . ' = ' . ($contentObjectType === 'USER' ? 'USER_INT' : 'USER') . '
-[global]
-';
-                               }
-                       }
-               }
-
                $pluginTemplate = 'plugin.tx_' . strtolower($extensionName) . ' {
        settings {
        }
@@ -133,7 +102,7 @@ tt_content.list.20.' . $pluginSignature . ' = ' . ($contentObjectType === 'USER'
 ' . $pluginTemplate);
 
                $pluginContent = trim('
-tt_content.list.20.' . $pluginSignature . ' = ' . $contentObjectType . '
+tt_content.list.20.' . $pluginSignature . ' = USER
 tt_content.list.20.' . $pluginSignature . ' {
        userFunc = tx_extbase_dispatcher->dispatch
        pluginName = ' . $pluginName . '
@@ -146,8 +115,7 @@ tt_content.list.20.' . $pluginSignature . ' {
        persistence =< plugin.tx_' . strtolower($extensionName) . '.persistence
        view =< plugin.tx_' . strtolower($extensionName) . '.view
        _LOCAL_LANG =< plugin.tx_' . strtolower($extensionName) . '._LOCAL_LANG
-}
-' . $conditions);
+}');
 
                t3lib_extMgm::addTypoScript($extensionName, 'setup', '
 # Setting ' . $extensionName . ' plugin TypoScript
@@ -334,7 +302,7 @@ tt_content.list.20.' . $pluginSignature . ' {
                return t3lib_div::underscoredToUpperCamelCase($camelCasedString);
        }
 
-               /**
+       /**
         * Build the autoload registry for a given extension and place it ext_autoload.php.
         *
         * @param       string  $extensionKey   Key of the extension
index 4fac067..fb663c4 100644 (file)
@@ -59,5 +59,47 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager_testcase extends Tx_
                $this->assertEquals(array('foo' => 'bar'), $this->frontendConfigurationManager->loadTypoScriptSetup());
        }
 
+       /**
+        * @test
+        */
+       public function overrideSwitchableControllerActionsFromFlexformMergesNonCacheableActions() {
+               $frameworkConfiguration = array(
+                       'userFunc' => 'tx_extbase_dispatcher->dispatch',
+                       'pluginName' => 'Pi1',
+                       'extensionName' => 'SomeExtension',
+                       'switchableControllerActions' => array(
+                               'Controller1' => array(
+                                       'controller' => 'Controller1',
+                                       'actions' => 'action1 , action2'
+                               ),
+                               'Controller2' => array(
+                                       'controller' => 'Controller2',
+                                       'actions' => 'action2 , action1,action3',
+                                       'nonCacheableActions' => 'action2, action3'
+                               )
+                       )
+               );
+               $flexformConfiguration = array(
+                       'switchableControllerActions' => 'Controller1->action2;Controller2->action3;Controller2->action1'
+               );
+               $expectedResult = array(
+                       'userFunc' => 'tx_extbase_dispatcher->dispatch',
+                       'pluginName' => 'Pi1',
+                       'extensionName' => 'SomeExtension',
+                       'switchableControllerActions' => array(
+                               'Controller1' => array(
+                                       'controller' => 'Controller1',
+                                       'actions' => 'action2'
+                               ),
+                               'Controller2' => array(
+                                       'controller' => 'Controller2',
+                                       'actions' => 'action3,action1',
+                                       'nonCacheableActions' => 'action3'
+                               )
+                       )
+               );
+               $actualResult = $this->frontendConfigurationManager->_callRef('overrideSwitchableControllerActionsFromFlexform', $frameworkConfiguration, $flexformConfiguration);
+               $this->assertEquals($expectedResult, $actualResult);
+       }
 }
 ?>
\ No newline at end of file
index cd7fdba..87d36ee 100644 (file)
@@ -44,26 +44,26 @@ class Tx_Extbase_MVC_Web_RequestBuilder_testcase extends Tx_Extbase_BaseTestCase
        public function setUp() {
                $this->configuration = array(
                        'userFunc' => 'Tx_Extbase_Dispatcher->dispatch',
-                       'pluginName' => 'pi1',
+                       'pluginName' => 'Pi1',
                        'extensionName' => 'MyExtension',
                        'controller' => 'TheFirstController',
                        'action' => 'show',
-                       'switchableControllerActions.' => array(
-                               '1.' => array(
+                       'switchableControllerActions' => array(
+                               'TheFirstController' => array(
                                        'controller' => 'TheFirstController',
                                        'actions' => 'show,index, ,new,create,delete,edit,update,setup,test'
-                                       ),
-                               '2.' => array(
+                               ),
+                               'TheSecondController' => array(
                                        'controller' => 'TheSecondController',
                                        'actions' => 'show, index'
-                                       ),
-                               '3.' => array(
+                               ),
+                               'TheThirdController' => array(
                                        'controller' => 'TheThirdController',
                                        'actions' => 'delete,create'
-                                       )
                                )
-                       );
-               $this->builder = new Tx_Extbase_MVC_Web_RequestBuilder;
+                       )
+               );
+               $this->builder = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_MVC_Web_RequestBuilder'), array('dummy'));
                $this->getBackup = $_GET;
                $this->postBackup = $_POST;
        }
@@ -80,7 +80,7 @@ class Tx_Extbase_MVC_Web_RequestBuilder_testcase extends Tx_Extbase_BaseTestCase
                $this->builder->initialize($this->configuration);
                $request = $this->builder->build();
                $this->assertEquals('Tx_Extbase_MVC_Web_Request', get_class($request));
-               $this->assertEquals('pi1', $request->getPluginName());
+               $this->assertEquals('Pi1', $request->getPluginName());
                $this->assertEquals('MyExtension', $request->getControllerExtensionName());
                $this->assertEquals('TheFirstController', $request->getControllerName());
                $this->assertEquals('show', $request->getControllerActionName());
@@ -104,10 +104,10 @@ class Tx_Extbase_MVC_Web_RequestBuilder_testcase extends Tx_Extbase_BaseTestCase
                $configuration = $this->configuration;
                unset($configuration['controller']);
                unset($configuration['action']);
-               unset($configuration['switchableControllerActions.']);
+               unset($configuration['switchableControllerActions']);
                $this->builder->initialize($configuration);
                $request = $this->builder->build();
-               $this->assertEquals('pi1', $request->getPluginName());
+               $this->assertEquals('Pi1', $request->getPluginName());
                $this->assertEquals('MyExtension', $request->getControllerExtensionName());
                $this->assertEquals('Standard', $request->getControllerName());
                $this->assertEquals('index', $request->getControllerActionName());
@@ -119,9 +119,10 @@ class Tx_Extbase_MVC_Web_RequestBuilder_testcase extends Tx_Extbase_BaseTestCase
        public function buildWithMissingActionsReturnsAWebRequestObjectWithDefaultControllerSettings() {
                $configuration = $this->configuration;
                unset($configuration['action']);
+               unset($configuration['switchableControllerActions']);
                $this->builder->initialize($configuration);
                $request = $this->builder->build();
-               $this->assertEquals('pi1', $request->getPluginName());
+               $this->assertEquals('Pi1', $request->getPluginName());
                $this->assertEquals('MyExtension', $request->getControllerExtensionName());
                $this->assertEquals('TheFirstController', $request->getControllerName());
                $this->assertEquals('index', $request->getControllerActionName());
@@ -140,9 +141,8 @@ class Tx_Extbase_MVC_Web_RequestBuilder_testcase extends Tx_Extbase_BaseTestCase
         * @test
         */
        public function buildSetsParametersFromGetAndPostVariables() {
-               $builder = $this->getMock($this->buildAccessibleProxy('Tx_Extbase_MVC_Web_RequestBuilder'), array('dummy'));
-               $builder->_set('extensionName', 'someExtensionName');
-               $builder->_set('pluginName', 'somePluginName');
+               $this->builder->_set('extensionName', 'someExtensionName');
+               $this->builder->_set('pluginName', 'somePluginName');
 
                $_GET = array(
                        'tx_someotherextensionname_somepluginname' => array(
@@ -167,7 +167,7 @@ class Tx_Extbase_MVC_Web_RequestBuilder_testcase extends Tx_Extbase_BaseTestCase
                        )
                );
 
-               $request = $builder->build();
+               $request = $this->builder->build();
                $expectedResult = array(
                        'parameter1' => 'value1',
                        'parameter2' => array(
@@ -179,5 +179,24 @@ class Tx_Extbase_MVC_Web_RequestBuilder_testcase extends Tx_Extbase_BaseTestCase
                $this->assertEquals($expectedResult, $actualResult);
        }
 
+       /**
+        * @test
+        */
+       public function initializeCorrectlySetsAllowedControllerActions() {
+               $this->builder->initialize($this->configuration);
+               $expectedResult = array(
+                       'TheFirstController' => array(
+                               'show', 'index', 'new', 'create', 'delete', 'edit', 'update', 'setup', 'test'
+                       ),
+                       'TheSecondController' => array(
+                               'show', 'index'
+                       ),
+                       'TheThirdController' => array(
+                               'delete', 'create'
+                       )
+               );
+               $actualResult = $this->builder->_get('allowedControllerActions');
+               $this->assertEquals($expectedResult, $actualResult);
+       }
 }
 ?>
\ No newline at end of file
index 8ae97e8..0ac3ead 100644 (file)
@@ -37,14 +37,34 @@ class Tx_Extbase_Utility_Extension_testcase extends tx_phpunit_testcase {
         */
        protected $typo3ConfVars = array();
 
+       /**
+        * @var t3lib_DB
+        */
+       protected $typo3DbBackup;
+
+       /**
+        * @var t3lib_fe contains a backup of the current $GLOBALS['TSFE']
+        */
+       protected $tsfeBackup;
+
        public function setUp() {
                global $TYPO3_CONF_VARS;
                $this->typo3ConfVars = $TYPO3_CONF_VARS;
+               $this->typo3DbBackup = $GLOBALS['TYPO3_DB'];
+               $GLOBALS['TYPO3_DB'] = $this->getMock('t3lib_DB', array('fullQuoteStr', 'exec_SELECTgetRows'));
+               $this->tsfeBackup = $GLOBALS['TSFE'];
+               if (!isset($GLOBALS['TSFE']->tmpl)) {
+                       $GLOBALS['TSFE']->tmpl = new stdClass();
+               }
+               if (!isset($GLOBALS['TSFE']->tmpl->setup)) {
+                       $GLOBALS['TSFE']->tmpl->setup = array();
+               }
        }
 
        public function tearDown() {
                global $TYPO3_CONF_VARS;
                $TYPO3_CONF_VARS = $this->typo3ConfVars;
+               $GLOBALS['TSFE'] = $this->tsfeBackup;
        }
 
        /**
@@ -162,7 +182,7 @@ plugin.tx_myextension {
         * @test
         * @see Tx_Extbase_Utility_Extension::registerPlugin
         */
-       public function configurePluginRespectsDefaultActionAsANonCachableAction() {
+       public function configurePluginRespectsDefaultActionAsANonCacheableAction() {
                global $TYPO3_CONF_VARS;
                $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.'] = array();
                Tx_Extbase_Utility_Extension::configurePlugin(
@@ -176,20 +196,18 @@ plugin.tx_myextension {
                                )
                        );
                $staticTypoScript = $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.']['43'];
-
                $this->assertContains('
-tt_content.list.20.myextension_pi1 = USER_INT
+tt_content.list.20.myextension_pi1 = USER
 tt_content.list.20.myextension_pi1 {', $staticTypoScript);
-               $this->assertContains('
-[globalString = GP:tx_myextension_pi1|controller = FirstController] && [globalString = GP:tx_myextension_pi1|action = /new|create|delete|edit|update/]
-tt_content.list.20.myextension_pi1 = USER', $staticTypoScript);
+               $this->assertContains('FirstController.nonCacheableActions = index,show
+', $staticTypoScript);
        }
 
        /**
         * @test
         * @see Tx_Extbase_Utility_Extension::registerPlugin
         */
-       public function configurePluginRespectsNonDefaultActionAsANonCachableAction() {
+       public function configurePluginRespectsNonDefaultActionAsANonCacheableAction() {
                global $TYPO3_CONF_VARS;
                $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.'] = array();
                Tx_Extbase_Utility_Extension::configurePlugin(
@@ -207,16 +225,15 @@ tt_content.list.20.myextension_pi1 = USER', $staticTypoScript);
                $this->assertContains('
 tt_content.list.20.myextension_pi1 = USER
 tt_content.list.20.myextension_pi1 {', $staticTypoScript);
-               $this->assertContains('
-[globalString = GP:tx_myextension_pi1|controller = FirstController] && [globalString = GP:tx_myextension_pi1|action = /show|new/]
-tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
+               $this->assertContains('FirstController.nonCacheableActions = show,new
+', $staticTypoScript);
        }
 
        /**
         * @test
         * @see Tx_Extbase_Utility_Extension::registerPlugin
         */
-       public function configurePluginWorksForMultipleControllerActionsWithCachableActionAsDefault() {
+       public function configurePluginWorksForMultipleControllerActionsWithCacheableActionAsDefault() {
                global $TYPO3_CONF_VARS;
                $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.'] = array();
                Tx_Extbase_Utility_Extension::configurePlugin(
@@ -231,8 +248,7 @@ tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
                                'FirstController' => 'new,create,edit,update',
                                'SecondController' => 'delete',
                                'ThirdController' => 'create'
-                               ),
-                       array('SecondController' => 'show')
+                               )
                        );
                $staticTypoScript = $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.']['43'];
 
@@ -240,17 +256,14 @@ tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
 tt_content.list.20.myextension_pi1 = USER
 tt_content.list.20.myextension_pi1 {', $staticTypoScript);
 
-               $this->assertContains('
-[globalString = GP:tx_myextension_pi1|controller = FirstController] && [globalString = GP:tx_myextension_pi1|action = /new|create|edit|update/]
-tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
+               $this->assertContains('FirstController.nonCacheableActions = new,create,edit,update
+', $staticTypoScript);
 
-               $this->assertContains('
-[globalString = GP:tx_myextension_pi1|controller = SecondController] && [globalString = GP:tx_myextension_pi1|action = /delete/]
-tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
+               $this->assertContains('SecondController.nonCacheableActions = delete
+', $staticTypoScript);
 
-               $this->assertContains('
-[globalString = GP:tx_myextension_pi1|controller = ThirdController] && [globalString = GP:tx_myextension_pi1|action = /create/]
-tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
+               $this->assertContains('ThirdController.nonCacheableActions = create
+', $staticTypoScript);
        }
 
 
@@ -258,7 +271,7 @@ tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
         * @test
         * @see Tx_Extbase_Utility_Extension::registerPlugin
         */
-       public function configurePluginWorksForMultipleControllerActionsWithNonCachableActionAsDefault() {
+       public function configurePluginWorksForMultipleControllerActionsWithNonCacheableActionAsDefault() {
                global $TYPO3_CONF_VARS;
                $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.'] = array();
                Tx_Extbase_Utility_Extension::configurePlugin(
@@ -278,53 +291,19 @@ tt_content.list.20.myextension_pi1 = USER_INT', $staticTypoScript);
                $staticTypoScript = $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.']['43'];
 
                $this->assertContains('
-tt_content.list.20.myextension_pi1 = USER_INT
+tt_content.list.20.myextension_pi1 = USER
 tt_content.list.20.myextension_pi1 {', $staticTypoScript);
 
-               $this->assertContains('
-[globalString = GP:tx_myextension_pi1|controller = FirstController] && [globalString = GP:tx_myextension_pi1|action = /show|delete/]
-tt_content.list.20.myextension_pi1 = USER', $staticTypoScript);
-
-               $this->assertContains('
-[globalString = GP:tx_myextension_pi1|controller = SecondController] && [globalString = GP:tx_myextension_pi1|action = /index|show/]
-tt_content.list.20.myextension_pi1 = USER', $staticTypoScript);
-
-               $this->assertNotContains('[globalString = GP:tx_myextension_pi1|controller = ThirdController]', $staticTypoScript);
-       }
-
-       /**
-        * @test
-        * @see Tx_Extbase_Utility_Extension::registerPlugin
-        */
-       public function configurePluginWorksForMultipleControllerActionsWithNonCachableActionAsDefaultAndOnlyNonCachableActions() {
-               global $TYPO3_CONF_VARS;
-               $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.'] = array();
-               Tx_Extbase_Utility_Extension::configurePlugin(
-                       'MyExtension',
-                       'Pi1',
-                       array(
-                               'FirstController' => 'index,show,new,create,delete,edit,update',
-                               'SecondController' => 'index,show,delete',
-                               'ThirdController' => 'create'
-                               ),
-                       array(
-                               'FirstController' => 'index,show,new,create,delete,edit,update',
-                               'SecondController' => 'index,show,delete',
-                               'ThirdController' => 'create'
-                               )
-                       );
-               $staticTypoScript = $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup.']['43'];
+               $this->assertContains('FirstController.nonCacheableActions = index,new,create,edit,update
+', $staticTypoScript);
 
-               $this->assertContains('
-tt_content.list.20.myextension_pi1 = USER_INT
-tt_content.list.20.myextension_pi1 {', $staticTypoScript);
+               $this->assertContains('SecondController.nonCacheableActions = delete
+', $staticTypoScript);
 
-               $this->assertNotContains('GP', $staticTypoScript);
+               $this->assertContains('ThirdController.nonCacheableActions = create
+', $staticTypoScript);
        }
 
-       // TODO switchableControllerActionsIsSupressedIfOnlyOneControllerActionIsGiven()
-       // TODO switchableControllerDingsIsGeneratedWithMultipleControllersEachHavingOnlyOneAction
-
 }
 
 ?>
\ No newline at end of file