[BUGFIX] Remove competing injects from WidgetRequestHandler 63/47163/8
authorAlexander Jahn <jahn.typo3@googlemail.com>
Wed, 9 Mar 2016 11:12:38 +0000 (12:12 +0100)
committerJan Helke <typo3@helke.de>
Fri, 18 Mar 2016 15:57:18 +0000 (16:57 +0100)
Removing @injects introduced explicit injectFunctions
into WidgetRequestHandler.
These functions were named after the object they inject.
This resulted in two methods injecting different objects into the same
property and in the end the parent class' function reverted the local
implementation.

Change-Id: I345d04f150fe6413ffc67c159c43cdda7e979e7b
Resolves: #74536
Related: #73018
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/47163
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
typo3/sysext/fluid/Tests/Unit/Core/Widget/WidgetRequestHandlerTest.php

index 212c681..a9ee9e3 100644 (file)
@@ -56,6 +56,14 @@ class WidgetRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHan
     /**
      * @param \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder
      */
+    public function injectRequestBuilder(\TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder)
+    {
+        // This method intentionally left blank
+    }
+
+    /**
+     * @param \TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder $requestBuilder
+     */
     public function injectWidgetRequestBuilder(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder $requestBuilder)
     {
         $this->requestBuilder = $requestBuilder;
index a26b308..ca14dc4 100644 (file)
@@ -78,7 +78,7 @@ class WidgetRequestHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $objectManager->expects($this->once())->method('get')->willReturn($this->getMock(Response::class));
         $requestDispatcher = $this->getMock(Dispatcher::class, array('dispatch'), array(), '', false);
         $requestDispatcher->expects($this->once())->method('dispatch')->with($request);
-        $this->inject($handler, 'requestBuilder', $requestBuilder);
+        $this->inject($handler, 'widgetRequestBuilder', $requestBuilder);
         $this->inject($handler, 'dispatcher', $requestDispatcher);
         $this->inject($handler, 'objectManager', $objectManager);
         $handler->handleRequest();