[!!!][CLEANUP] Remove deprecated code in sysext fluid 69/33769/9
authorMarkus Klein <klein.t3@reelworx.at>
Tue, 4 Nov 2014 00:16:57 +0000 (01:16 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 19 Nov 2014 10:29:53 +0000 (11:29 +0100)
Resolves: #53542
Releases: master
Change-Id: I9c90dae141a6cf1cf6871ad70d0de4905ab8e1ec
Reviewed-on: http://review.typo3.org/33769
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Documentation/Changelog/master/Breaking-53542-DeprecatedCodeRemovalInFluid.rst [new file with mode: 0644]
typo3/sysext/documentation/Resources/Private/Layouts/Default.html
typo3/sysext/extensionmanager/Resources/Private/Layouts/Main.html
typo3/sysext/fluid/Classes/View/TemplateView.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/AbstractBackendViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/ContainerViewHelper.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/AbstractWidgetControllerTest.php
typo3/sysext/fluid/Tests/Unit/View/TemplateViewTest.php
typo3/sysext/install/Classes/ViewHelpers/Be/ContainerViewHelper.php
typo3/sysext/install/Resources/Private/Layouts/BackendModule.html
typo3/sysext/lang/Resources/Private/Layouts/Default.html

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-53542-DeprecatedCodeRemovalInFluid.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-53542-DeprecatedCodeRemovalInFluid.rst
new file mode 100644 (file)
index 0000000..503d240
--- /dev/null
@@ -0,0 +1,50 @@
+=============================================================
+Breaking: #62416 - Removal of deprecated code in sysext fluid
+=============================================================
+
+Description
+===========
+
+ContainerViewHelper
+-------------------
+
+The following options have been removed from the ViewHelper:
+
+* enableJumpToUrl
+* addCssFile, use includeCssFiles instead
+* addJsFile, use includeJsFiles instead
+
+
+AbstractBackendViewHelper
+-------------------------
+
+The usage of $GLOBALS['SOBE'] is removed for retrieving the DocumentTemplate instance.
+Use ->getDocInstance() instead.
+
+
+TemplateView
+------------
+
+The following methods have been removed:
+
+* getTemplateRootPath() is removed, use getTemplateRootPaths() instead
+* getPartialRootPath is removed, use setPartialRootPaths() instead
+* getLayoutRootPath is removed, use getLayoutRootPaths() instead
+
+
+Impact
+======
+
+A call to any of the aforementioned methods by third party code will result in a fatal PHP error.
+
+
+Affected installations
+======================
+
+Any installation which contains third party code still using these deprecated methods.
+
+
+Migration
+=========
+
+Replace the calls with the suggestions outlined above.
index f1b7d0c..4d50a22 100644 (file)
@@ -1,6 +1,6 @@
 {namespace doc=TYPO3\CMS\Documentation\ViewHelpers}
 
-<f:be.container pageTitle="{f:translate(key: 'documentation_manager')}" enableJumpToUrl="true" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" loadExtJs="false" loadExtJsTheme="true" loadJQuery="true"
+<f:be.container pageTitle="{f:translate(key: 'documentation_manager')}" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" loadExtJs="false" loadExtJsTheme="true" loadJQuery="true"
 
        includeCssFiles="{
                0:'{f:uri.resource(path:\'Css/main.css\')}',
@@ -33,4 +33,4 @@
                        <f:render section="Content" />
                </div>
        </div>
-</f:be.container>
\ No newline at end of file
+</f:be.container>
index e66ef7a..e9e492b 100644 (file)
@@ -1,6 +1,6 @@
 {namespace em=TYPO3\CMS\Extensionmanager\ViewHelpers}
 
-<f:be.container pageTitle="Extension Manager" enableJumpToUrl="true" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" loadExtJs="false" loadExtJsTheme="true" loadJQuery="true"
+<f:be.container pageTitle="Extension Manager" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" loadExtJs="false" loadExtJsTheme="true" loadJQuery="true"
 
        includeCssFiles="{
                0:'{f:uri.resource(path:\'Contrib/jQueryUI/jquery-ui-1.10.3.custom.min.css\')}',
index 05899d6..98db4da 100644 (file)
@@ -11,8 +11,11 @@ namespace TYPO3\CMS\Fluid\View;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
+use TYPO3\CMS\Fluid\Compatibility\TemplateParserBuilder;
+use TYPO3\CMS\Fluid\Fluid;
 
 /**
  * The main template view. Should be used as view if you want Fluid Templating
@@ -125,12 +128,18 @@ class TemplateView extends AbstractTemplateView {
         */
        protected $layoutPathAndFilename = NULL;
 
+       /**
+        * Constructor
+        */
        public function __construct() {
-               $this->templateParser = \TYPO3\CMS\Fluid\Compatibility\TemplateParserBuilder::build();
+               $this->templateParser = TemplateParserBuilder::build();
                $this->objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
                $this->setRenderingContext($this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface'));
        }
 
+       /**
+        * Init view
+        */
        public function initializeView() {
        }
        // Here, the backporter can insert a constructor method, which is needed for the TYPO3 CMS extension
@@ -172,16 +181,6 @@ class TemplateView extends AbstractTemplateView {
        }
 
        /**
-        * @return string Path to template root directory
-        * @deprecated since fluid 6.2, will be removed two versions later. Use getTemplateRootPaths() instead
-        */
-       protected function getTemplateRootPath() {
-               GeneralUtility::logDeprecatedFunction();
-               $templateRootPaths = $this->getTemplateRootPaths();
-               return array_shift($templateRootPaths);
-       }
-
-       /**
         * Resolves the template root to be used inside other paths.
         *
         * @return array Path(s) to template root directory
@@ -192,7 +191,7 @@ class TemplateView extends AbstractTemplateView {
                }
                /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
                $actionRequest = $this->controllerContext->getRequest();
-               return array(str_replace('@packageResourcesPath', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->templateRootPathPattern));
+               return array(str_replace('@packageResourcesPath', ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->templateRootPathPattern));
        }
 
        /**
@@ -221,16 +220,6 @@ class TemplateView extends AbstractTemplateView {
        }
 
        /**
-        * @return string Path to partial root directory
-        * @deprecated since fluid 6.2, will be removed two versions later. Use setPartialRootPaths() instead
-        */
-       protected function getPartialRootPath() {
-               GeneralUtility::logDeprecatedFunction();
-               $partialRootPaths = $this->getPartialRootPaths();
-               return array_shift($partialRootPaths);
-       }
-
-       /**
         * Set the root path(s) to the partials.
         * If set, overrides the one determined from $this->partialRootPathPattern
         *
@@ -253,7 +242,7 @@ class TemplateView extends AbstractTemplateView {
                }
                /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
                $actionRequest = $this->controllerContext->getRequest();
-               return array(str_replace('@packageResourcesPath', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->partialRootPathPattern));
+               return array(str_replace('@packageResourcesPath', ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->partialRootPathPattern));
        }
 
        /**
@@ -282,16 +271,6 @@ class TemplateView extends AbstractTemplateView {
        }
 
        /**
-        * @return string Path to layout root directory
-        * @deprecated since fluid 6.2, will be removed two versions later. Use getLayoutRootPaths() instead
-        */
-       protected function getLayoutRootPath() {
-               GeneralUtility::logDeprecatedFunction();
-               $layoutRootPaths = $this->getLayoutRootPaths();
-               return array_shift($layoutRootPaths);
-       }
-
-       /**
         * Resolves the layout root to be used inside other paths.
         *
         * @return string Path(s) to layout root directory
@@ -302,7 +281,7 @@ class TemplateView extends AbstractTemplateView {
                }
                /** @var $actionRequest \TYPO3\CMS\Extbase\Mvc\Request */
                $actionRequest = $this->controllerContext->getRequest();
-               return array(str_replace('@packageResourcesPath', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->layoutRootPathPattern));
+               return array(str_replace('@packageResourcesPath', ExtensionManagementUtility::extPath($actionRequest->getControllerExtensionKey()) . 'Resources/', $this->layoutRootPathPattern));
        }
 
        /**
@@ -540,10 +519,10 @@ class TemplateView extends AbstractTemplateView {
                $subpackageKey = $actionRequest->getControllerSubpackageKey();
                $controllerName = $actionRequest->getControllerName();
                if ($subpackageKey !== NULL) {
-                       if (strpos($subpackageKey, \TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR) !== FALSE) {
-                               $namespaceSeparator = \TYPO3\CMS\Fluid\Fluid::NAMESPACE_SEPARATOR;
+                       if (strpos($subpackageKey, Fluid::NAMESPACE_SEPARATOR) !== FALSE) {
+                               $namespaceSeparator = Fluid::NAMESPACE_SEPARATOR;
                        } else {
-                               $namespaceSeparator = \TYPO3\CMS\Fluid\Fluid::LEGACY_NAMESPACE_SEPARATOR;
+                               $namespaceSeparator = Fluid::LEGACY_NAMESPACE_SEPARATOR;
                        }
                        $subpackageKeyParts = explode($namespaceSeparator, $subpackageKey);
                } else {
index 6957662..ef861f6 100644 (file)
@@ -1,8 +1,6 @@
 <?php
 namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
 
-use \TYPO3\CMS\Core\Utility\GeneralUtility;
-
 /*                                                                        *
  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid".   *
  *                                                                        *
@@ -22,72 +20,31 @@ use \TYPO3\CMS\Core\Utility\GeneralUtility;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
+
+use TYPO3\CMS\Backend\Template\DocumentTemplate;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
+
 /**
  * The abstract base class for all backend view helpers
  * Note: backend view helpers are still experimental!
  */
-abstract class AbstractBackendViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper {
+abstract class AbstractBackendViewHelper extends AbstractViewHelper {
 
        /**
         * Gets instance of template if exists or create a new one.
         * Saves instance in viewHelperVariableContainer
         *
-        * @return \TYPO3\CMS\Backend\Template\DocumentTemplate $doc
+        * @return DocumentTemplate $doc
         */
        public function getDocInstance() {
-               if ($this->viewHelperVariableContainer->exists(
-                       'TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\AbstractBackendViewHelper',
-                       'DocumentTemplate'
-               )
-               ) {
-                       $doc = $this->viewHelperVariableContainer->get(
-                               'TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\AbstractBackendViewHelper',
-                               'DocumentTemplate'
-                       );
+               if ($this->viewHelperVariableContainer->exists(AbstractBackendViewHelper::class, 'DocumentTemplate')) {
+                       $doc = $this->viewHelperVariableContainer->get(AbstractBackendViewHelper::class, 'DocumentTemplate');
                } else {
-                       /** @var $doc \TYPO3\CMS\Backend\Template\DocumentTemplate */
-                       $doc = $this->createDocInstance();
+                       /** @var $doc DocumentTemplate */
+                       $doc = GeneralUtility::makeInstance(DocumentTemplate::class);
                        $doc->backPath = $GLOBALS['BACK_PATH'];
-                       $this->viewHelperVariableContainer->add(
-                               'TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\AbstractBackendViewHelper',
-                               'DocumentTemplate',
-                               $doc
-                       );
-               }
-
-               return $doc;
-       }
-
-       /**
-        * Other extensions may rely on the fact that $GLOBALS['SOBE'] exists and holds
-        * the DocumentTemplate instance. We should really get rid of this, but for now, let's be backwards compatible.
-        * Relying on $GLOBALS['SOBE'] is @deprecated since 6.0 and will be removed in 6.2 Instead ->getDocInstance() should be used.
-        *
-        * If $GLOBALS['SOBE']->doc holds an instance of \TYPO3\CMS\Backend\Template\DocumentTemplate we reuse it,
-        * if not we create a new one.
-        *
-        * Relying on $GLOBALS['SOBE'] is
-        * @deprecated since 6.0 and will be removed in 6.2 ->getDocInstance() should be used instead.
-        *
-        * @return \TYPO3\CMS\Backend\Template\DocumentTemplate
-        */
-       protected function createDocInstance() {
-               if (
-                       isset($GLOBALS['SOBE']) &&
-                       is_object($GLOBALS['SOBE']) &&
-                       isset($GLOBALS['SOBE']->doc) &&
-                       $GLOBALS['SOBE']->doc instanceof \TYPO3\CMS\Backend\Template\DocumentTemplate
-               ) {
-                       GeneralUtility::deprecationLog('Usage of $GLOBALS[\'SOBE\'] is deprecated since 6.0 and will be removed in 6.2 ->getDocInstance() should be used instead');
-                       $doc = $GLOBALS['SOBE']->doc;
-               } else {
-                       $doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
-                       if (!isset($GLOBALS['SOBE'])) {
-                               $GLOBALS['SOBE'] = new \stdClass();
-                       }
-                       if (!isset($GLOBALS['SOBE']->doc)) {
-                               $GLOBALS['SOBE']->doc = $doc;
-                       }
+                       $this->viewHelperVariableContainer->add(AbstractBackendViewHelper::class, 'DocumentTemplate', $doc);
                }
 
                return $doc;
index aae5dc7..1f9ea24 100644 (file)
@@ -21,7 +21,8 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
-use \TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
+
 
 /**
  * View helper which allows you to create extbase based modules in the style of TYPO3 default modules.
@@ -36,8 +37,8 @@ use \TYPO3\CMS\Core\Utility\GeneralUtility;
  * Default backend CSS styles and JavaScript will be included
  * </output>
  *
- * <code title="All options (except deprecated ones)">
- * <f:be.container pageTitle="foo" enableJumpToUrl="false" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" scriptaculousModule="someModule,someOtherModule" loadExtJs="true" loadExtJsTheme="false" extJsAdapter="jQuery" enableExtJsDebug="true" loadJQuery="true" includeCssFiles="0: '{f:uri.resource(path:\'Styles/Styles.css\')}'" includeJsFiles="0: '{f:uri.resource(path:\'JavaScript/Library1.js\')}', 1: '{f:uri.resource(path:\'JavaScript/Library2.js\')}'" addJsInlineLabels="{0: 'label1', 1: 'label2'}" includeCsh="true">your module content</f:be.container>
+ * <code title="All options">
+ * <f:be.container pageTitle="foo" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" scriptaculousModule="someModule,someOtherModule" loadExtJs="true" loadExtJsTheme="false" extJsAdapter="jQuery" enableExtJsDebug="true" loadJQuery="true" includeCssFiles="0: '{f:uri.resource(path:\'Styles/Styles.css\')}'" includeJsFiles="0: '{f:uri.resource(path:\'JavaScript/Library1.js\')}', 1: '{f:uri.resource(path:\'JavaScript/Library2.js\')}'" addJsInlineLabels="{0: 'label1', 1: 'label2'}" includeCsh="true">your module content</f:be.container>
  * </code>
  * <output>
  * "your module content" wrapped with proper head & body tags.
@@ -46,23 +47,20 @@ use \TYPO3\CMS\Core\Utility\GeneralUtility;
  * will be loaded, plus ExtJS and jQuery and some inline labels for usage in JS code.
  * </output>
  */
-class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewHelper {
+class ContainerViewHelper extends AbstractBackendViewHelper {
 
        /**
         * Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate and pageTitle
         *
-        * @param string  $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
-        * @param bool $enableJumpToUrl If TRUE, includes "jumpTpUrl" javascript function required by ActionMenu. Defaults to TRUE, deprecated, as not needed anymore
+        * @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
         * @param bool $enableClickMenu If TRUE, loads clickmenu.js required by BE context menus. Defaults to TRUE
         * @param bool $loadPrototype specifies whether to load prototype library. Defaults to TRUE
         * @param bool $loadScriptaculous specifies whether to load scriptaculous libraries. Defaults to FALSE
-        * @param string  $scriptaculousModule additionales modules for scriptaculous
+        * @param string $scriptaculousModule additionales modules for scriptaculous
         * @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
         * @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
-        * @param string  $extJsAdapter load alternative adapter (ext-base is default adapter)
+        * @param string $extJsAdapter load alternative adapter (ext-base is default adapter)
         * @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
-        * @param string $addCssFile Custom CSS file to be loaded (deprecated, use $includeCssFiles)
-        * @param string $addJsFile Custom JavaScript file to be loaded (deprecated, use $includeJsFiles)
         * @param bool $loadJQuery whether to load jQuery library. Defaults to FALSE
         * @param array $includeCssFiles List of custom CSS file to be loaded
         * @param array $includeJsFiles List of custom JavaScript file to be loaded
@@ -72,7 +70,7 @@ class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
         * @see \TYPO3\CMS\Backend\Template\DocumentTemplate
         * @see \TYPO3\CMS\Core\Page\PageRenderer
         */
-       public function render($pageTitle = '', $enableJumpToUrl = TRUE, $enableClickMenu = TRUE, $loadPrototype = TRUE, $loadScriptaculous = FALSE, $scriptaculousModule = '', $loadExtJs = FALSE, $loadExtJsTheme = TRUE, $extJsAdapter = '', $enableExtJsDebug = FALSE, $addCssFile = NULL, $addJsFile = NULL, $loadJQuery = FALSE, $includeCssFiles = NULL, $includeJsFiles = NULL, $addJsInlineLabels = NULL, $includeCsh = TRUE) {
+       public function render($pageTitle = '', $enableClickMenu = TRUE, $loadPrototype = TRUE, $loadScriptaculous = FALSE, $scriptaculousModule = '', $loadExtJs = FALSE, $loadExtJsTheme = TRUE, $extJsAdapter = '', $enableExtJsDebug = FALSE, $loadJQuery = FALSE, $includeCssFiles = NULL, $includeJsFiles = NULL, $addJsInlineLabels = NULL, $includeCsh = TRUE) {
                $doc = $this->getDocInstance();
                $pageRenderer = $doc->getPageRenderer();
                $doc->JScode .= $doc->wrapScriptTags($doc->redirectUrls());
@@ -96,15 +94,6 @@ class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
                if ($loadJQuery) {
                        $pageRenderer->loadJquery(NULL, NULL, $pageRenderer::JQUERY_NAMESPACE_DEFAULT_NOCONFLICT);
                }
-               // This way of adding a single CSS or JS file is deprecated, the array below should be used instead
-               if ($addCssFile !== NULL) {
-                       GeneralUtility::deprecationLog('Usage of addCssFile attribute is deprecated since TYPO3 CMS 6.2. It will be removed in TYPO3 CMS 7.0. Use includeCssFiles instead.');
-                       $pageRenderer->addCssFile($addCssFile);
-               }
-               if ($addJsFile !== NULL) {
-                       GeneralUtility::deprecationLog('Usage of addJsFile attribute is deprecated since TYPO3 CMS 6.2. It will be removed in TYPO3 CMS 7.0. Use includeJsFiles instead.');
-                       $pageRenderer->addJsFile($addJsFile);
-               }
                // Include custom CSS and JS files
                if (is_array($includeCssFiles) && count($includeCssFiles) > 0) {
                        foreach ($includeCssFiles as $addCssFile) {
@@ -120,7 +109,7 @@ class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
                if (is_array($addJsInlineLabels) && count($addJsInlineLabels) > 0) {
                        $extensionKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
                        foreach ($addJsInlineLabels as $key) {
-                               $label = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, $extensionKey);
+                               $label = LocalizationUtility::translate($key, $extensionKey);
                                $pageRenderer->addInlineLanguageLabel($key, $label);
                        }
                }
index 2b29d99..fb0a3a4 100644 (file)
@@ -21,6 +21,12 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Widget;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Mvc\Controller\Arguments;
+use TYPO3\CMS\Extbase\Mvc\ResponseInterface;
+use TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController;
+use TYPO3\CMS\Fluid\Core\Widget\WidgetRequest;
+
 /**
  * Test case
  */
@@ -30,7 +36,9 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function canHandleWidgetRequest() {
+               /** @var WidgetRequest|\PHPUnit_Framework_MockObject_MockObject $request */
                $request = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array('dummy'), array(), '', FALSE);
+               /** @var AbstractWidgetController|\PHPUnit_Framework_MockObject_MockObject $abstractWidgetController */
                $abstractWidgetController = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('dummy'), array(), '', FALSE);
                $this->assertTrue($abstractWidgetController->canProcessRequest($request));
        }
@@ -41,9 +49,12 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function processRequestSetsWidgetConfiguration() {
                $widgetContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetContext');
                $widgetContext->expects($this->once())->method('getWidgetConfiguration')->will($this->returnValue('myConfiguration'));
+               /** @var WidgetRequest|\PHPUnit_Framework_MockObject_MockObject $request */
                $request = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\WidgetRequest', array(), array(), '', FALSE);
                $request->expects($this->once())->method('getWidgetContext')->will($this->returnValue($widgetContext));
+               /** @var ResponseInterface|\PHPUnit_Framework_MockObject_MockObject $response */
                $response = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface');
+               /** @var AbstractWidgetController|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $abstractWidgetController */
                $abstractWidgetController = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController', array('resolveActionMethodName', 'initializeActionMethodArguments', 'initializeActionMethodValidators', 'initializeAction', 'checkRequestHash', 'mapRequestArgumentsToControllerArguments', 'buildControllerContext', 'resolveView', 'callActionMethod'), array(), '', FALSE);
                $mockUriBuilder = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
                $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
@@ -51,7 +62,7 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
                $configurationService = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfigurationService');
                $abstractWidgetController->_set('mvcPropertyMappingConfigurationService', $configurationService);
-               $abstractWidgetController->_set('arguments', new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments());
+               $abstractWidgetController->_set('arguments', new Arguments());
 
                $abstractWidgetController->_set('objectManager', $objectManager);
                $abstractWidgetController->processRequest($request, $response);
@@ -83,6 +94,6 @@ class AbstractWidgetControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $abstractWidgetController->_set('configurationManager', $configurationManager);
                $abstractWidgetController->_set('request', $request);
                $abstractWidgetController->_call('setViewConfiguration', $view);
-               $this->assertEquals(\TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:fluid/Resources/Private/DummyTestTemplates'), $view->_call('getTemplateRootPath'));
+               $this->assertSame(array(GeneralUtility::getFileAbsFileName('EXT:fluid/Resources/Private/DummyTestTemplates')), $view->_call('getTemplateRootPaths'));
        }
 }
index 12b70bc..e68ac44 100644 (file)
@@ -16,6 +16,7 @@ include_once(__DIR__ . '/Fixtures/TemplateViewFixture.php');
 
 use org\bovigo\vfs\vfsStreamWrapper;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use TYPO3\CMS\Fluid\View\TemplateView;
 
 /**
  * Test case
@@ -29,9 +30,8 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function expandGenericPathPatternWorksWithOldNamingSchemeOfSubPackage() {
                $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'ViewHelpers_Widget', 'Paginate', 'html');
-               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPath', 'getPartialRootPath', 'getLayoutRootPath'), array(), '', FALSE);
+               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
                $templateView->_set('controllerContext', $mockControllerContext);
-               $templateView->expects($this->any())->method('getTemplateRootPath')->will($this->returnValue('Resources/Private/'));
                $expected = array(ExtensionManagementUtility::extPath('frontend') . 'Resources/Private/Templates/ViewHelpers/Widget/Paginate/@action.html');
                $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/@subpackage/@controller/@action.@format', FALSE, FALSE);
                $this->assertEquals($expected, $actual);
@@ -44,9 +44,8 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function expandGenericPathPatternWorksWithNewNamingSchemeOfSubPackage() {
                $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'ViewHelpers\\Widget', 'Paginate', 'html');
-               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPath', 'getPartialRootPath', 'getLayoutRootPath'), array(), '', FALSE);
+               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
                $templateView->_set('controllerContext', $mockControllerContext);
-               $templateView->expects($this->any())->method('getTemplateRootPath')->will($this->returnValue('Resources/Private/'));
                $expected = array(ExtensionManagementUtility::extPath('frontend') . 'Resources/Private/Templates/ViewHelpers/Widget/Paginate/@action.html');
                $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/@subpackage/@controller/@action.@format', FALSE, FALSE);
                $this->assertEquals($expected, $actual);
@@ -77,6 +76,9 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                return $mockControllerContext;
        }
 
+       /**
+        * @return array
+        */
        public function expandGenericPathPatternDataProvider() {
                return array(
                        // bubbling controller & subpackage parts and optional format
@@ -488,7 +490,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function expandGenericPathPatternTests($package, $subPackage, $controller, $format, $templateRootPath, array $templateRootPaths = NULL, $partialRootPath, array $partialRootPaths = NULL, $layoutRootPath, array $layoutRootPaths = NULL, $bubbleControllerAndSubpackage, $formatIsOptional, $pattern, $expectedResult) {
                $mockControllerContext = $this->setupMockControllerContextForPathResolving($package, $subPackage, $controller, $format);
 
-               /** @var \TYPO3\CMS\Fluid\View\TemplateView $templateView */
+               /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
                $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
                $templateView->setControllerContext($mockControllerContext);
                if ($templateRootPath !== NULL) {
@@ -522,7 +524,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function expandGenericPathPatternWorksWithBubblingDisabledAndFormatNotOptional() {
                $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', NULL, 'My', 'html');
 
-               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths', 'getPartialRootPath', 'getLayoutRootPath'), array(), '', FALSE);
+               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
                $templateView->_set('controllerContext', $mockControllerContext);
                $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
 
@@ -538,7 +540,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function expandGenericPathPatternWorksWithSubpackageAndBubblingDisabledAndFormatNotOptional() {
                $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
 
-               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths', 'getPartialRootPath', 'getLayoutRootPath'), array(), '', FALSE);
+               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
                $templateView->_set('controllerContext', $mockControllerContext);
                $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
                $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', FALSE, FALSE);
@@ -555,7 +557,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function expandGenericPathPatternWorksWithSubpackageAndBubblingDisabledAndFormatOptional() {
                $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
 
-               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths', 'getPartialRootPath', 'getLayoutRootPath'), array(), '', FALSE);
+               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
                $templateView->_set('controllerContext', $mockControllerContext);
                $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
                $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', FALSE, TRUE);
@@ -573,7 +575,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function expandGenericPathPatternWorksWithSubpackageAndBubblingEnabledAndFormatOptional() {
                $mockControllerContext = $this->setupMockControllerContextForPathResolving('MyPackage', 'MySubPackage', 'My', 'html');
 
-               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths', 'getPartialRootPath', 'getLayoutRootPath'), array(), '', FALSE);
+               $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('getTemplateRootPaths'), array(), '', FALSE);
                $templateView->_set('controllerContext', $mockControllerContext);
                $templateView->expects($this->any())->method('getTemplateRootPaths')->will($this->returnValue(array('Resources/Private/')));
                $actual = $templateView->_call('expandGenericPathPattern', '@templateRoot/Templates/@subpackage/@controller/@action.@format', TRUE, TRUE);
@@ -593,6 +595,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getTemplateRootPathsReturnsUserSpecifiedTemplatePaths() {
+               /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
                $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
                $templateView->setTemplateRootPath('/foo/bar');
                $expected = array('/foo/bar');
@@ -604,6 +607,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function setTemplateRootPathOverrulesSetTemplateRootPaths() {
+               /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
                $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
                $templateView->setTemplateRootPath('/foo/bar');
                $templateView->setTemplateRootPaths(array('/overruled/path'));
@@ -616,6 +620,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getPartialRootPathsReturnsUserSpecifiedPartialPath() {
+               /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
                $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
                $templateView->setPartialRootPath('/foo/bar');
                $expected = array('/foo/bar');
@@ -627,6 +632,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function getLayoutRootPathsReturnsUserSpecifiedPartialPath() {
+               /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
                $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('dummy'), array(), '', FALSE);
                $templateView->setLayoutRootPath('/foo/bar');
                $expected = array('/foo/bar');
@@ -648,6 +654,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'vfs://MyPartials/SomePartial'
                );
 
+               /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
                $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', FALSE);
                $templateView->expects($this->once())->method('expandGenericPathPattern')->with('@partialRoot/@subpackage/@partial.@format', TRUE, TRUE)->will($this->returnValue($paths));
                $templateView->expects($this->any())->method('resolveFileNamePath')->will($this->onConsecutiveCalls(
@@ -676,6 +683,7 @@ class TemplateViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'vfs://MyTemplates/@action.html'
                );
 
+               /** @var TemplateView|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface $templateView */
                $templateView = $this->getAccessibleMock('TYPO3\\CMS\\Fluid\\View\\TemplateView', array('expandGenericPathPattern', 'resolveFileNamePath'), array(), '', FALSE);
                $templateView->expects($this->once())->method('expandGenericPathPattern')->with('@templateRoot/@subpackage/@controller/@action.@format', FALSE, FALSE)->will($this->returnValue($paths));
                $templateView->expects($this->any())->method('resolveFileNamePath')->will($this->onConsecutiveCalls(
index 0395701..e1be6ec 100644 (file)
@@ -30,10 +30,10 @@ namespace TYPO3\CMS\Install\ViewHelpers\Be;
  * </output>
  *
  * <code title="All options">
- * <f:be.container pageTitle="foo" enableJumpToUrl="false" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" scriptaculousModule="someModule,someOtherModule" loadExtJs="true" loadExtJsTheme="false" extJsAdapter="jQuery" enableExtJsDebug="true" addCssFile="{f:uri.resource(path:'styles/backend.css')}" addJsFile="{f:uri.resource(path:'scripts/main.js')}">your module content</f:be.container>
+ * <f:be.container pageTitle="foo" enableClickMenu="false" loadPrototype="false" loadScriptaculous="false" scriptaculousModule="someModule,someOtherModule" loadExtJs="true" loadExtJsTheme="false" extJsAdapter="jQuery" enableExtJsDebug="true">your module content</f:be.container>
  * </code>
  * <output>
- * "your module content" wrapped with propper head & body tags.
+ * "your module content" wrapped with proper head & body tags.
  * Custom CSS file EXT:your_extension/Resources/Public/styles/backend.css and JavaScript file EXT:your_extension/Resources/Public/scripts/main.js will be loaded
  * </output>
  *
@@ -44,15 +44,14 @@ class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
        /**
         * Render start page with \TYPO3\CMS\Backend\Template\DocumentTemplate and pageTitle
         *
-        * @param string  $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
-        * @param bool $enableJumpToUrl If TRUE, includes "jumpTpUrl" javascript function required by ActionMenu. Defaults to TRUE, not needed anymore, as it is included all the time
+        * @param string $pageTitle title tag of the module. Not required by default, as BE modules are shown in a frame
         * @param bool $enableClickMenu If TRUE, loads clickmenu.js required by BE context menus. Defaults to TRUE
         * @param bool $loadPrototype specifies whether to load prototype library. Defaults to TRUE
         * @param bool $loadScriptaculous specifies whether to load scriptaculous libraries. Defaults to FALSE
-        * @param string  $scriptaculousModule additionales modules for scriptaculous
+        * @param string $scriptaculousModule additionales modules for scriptaculous
         * @param bool $loadExtJs specifies whether to load ExtJS library. Defaults to FALSE
         * @param bool $loadExtJsTheme whether to load ExtJS "grey" theme. Defaults to FALSE
-        * @param string  $extJsAdapter load alternative adapter (ext-base is default adapter)
+        * @param string $extJsAdapter load alternative adapter (ext-base is default adapter)
         * @param bool $enableExtJsDebug if TRUE, debug version of ExtJS is loaded. Use this for development only
         * @param array $addCssFiles Custom CSS files to be loaded
         * @param array $addJsFiles Custom JavaScript files to be loaded
@@ -62,7 +61,7 @@ class ContainerViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
         * @see \TYPO3\CMS\Backend\Template\DocumentTemplate
         * @see \TYPO3\CMS\Core\Page\PageRenderer
         */
-       public function render($pageTitle = '', $enableJumpToUrl = TRUE, $enableClickMenu = TRUE, $loadPrototype = TRUE, $loadScriptaculous = FALSE, $scriptaculousModule = '', $loadExtJs = FALSE, $loadExtJsTheme = TRUE, $extJsAdapter = '', $enableExtJsDebug = FALSE, $addCssFiles = array(), $addJsFiles = array(), $triggers = array()) {
+       public function render($pageTitle = '', $enableClickMenu = TRUE, $loadPrototype = TRUE, $loadScriptaculous = FALSE, $scriptaculousModule = '', $loadExtJs = FALSE, $loadExtJsTheme = TRUE, $extJsAdapter = '', $enableExtJsDebug = FALSE, $addCssFiles = array(), $addJsFiles = array(), $triggers = array()) {
                $doc = $this->getDocInstance();
                $pageRenderer = $doc->getPageRenderer();
 
index b719c05..4914dc7 100644 (file)
@@ -7,7 +7,6 @@
 
 <i:be.container
        pageTitle="Install tool"
-       enableJumpToUrl="true"
        enableClickMenu="false"
        loadPrototype="false"
        loadScriptaculous="false"
index 59f3e6a..e122bd7 100644 (file)
@@ -1,5 +1,4 @@
 <f:be.container
-       enableJumpToUrl="0"
        enableClickMenu="0"
        loadPrototype="0"
        loadScriptaculous="0"
@@ -48,4 +47,4 @@
                </div>
 
        </div>
-</f:be.container>
\ No newline at end of file
+</f:be.container>