[TASK] Avoid superfluous Reflection invocation in tests 44/62844/3
authorOliver Hader <oliver@typo3.org>
Fri, 10 Jan 2020 15:31:24 +0000 (16:31 +0100)
committerDaniel Goerz <daniel.goerz@posteo.de>
Tue, 14 Jan 2020 10:25:24 +0000 (11:25 +0100)
Resolves: #90086
Releases: master, 9.5
Change-Id: Ibe5eb0db866933984a07ac5f5b82010a0ae4698b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62844
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
typo3/sysext/extbase/Tests/Functional/Mvc/Controller/ActionControllerTest.php

index a772e96..34c0f0a 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Extbase\Tests\Functional\Mvc\Controller;
  */
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Mvc\Controller\Arguments;
 use TYPO3\CMS\Extbase\Mvc\Web\Request;
 use TYPO3\CMS\Extbase\Mvc\Web\Response;
 use TYPO3\CMS\Extbase\Object\ObjectManager;
@@ -73,15 +72,8 @@ class ActionControllerTest extends \TYPO3\TestingFramework\Core\Functional\Funct
         // Test run
         $this->controller->processRequest($this->request, $this->response);
 
-        // Open arguments property
-        $reflectionClass = new \ReflectionClass($this->controller);
-        $argumentsProperty = $reflectionClass->getProperty('arguments');
-        $argumentsProperty->setAccessible(true);
-
         // Assertions
-
-        /** @var Arguments $arguments */
-        $arguments = $argumentsProperty->getValue($this->controller);
+        $arguments = $this->controller->getControllerContext()->getArguments();
         $argument = $arguments->getArgument('barParam');
 
         /** @var ConjunctionValidator $validator */
@@ -108,15 +100,8 @@ class ActionControllerTest extends \TYPO3\TestingFramework\Core\Functional\Funct
         // Test run
         $this->controller->processRequest($this->request, $this->response);
 
-        // Open arguments property
-        $reflectionClass = new \ReflectionClass($this->controller);
-        $argumentsProperty = $reflectionClass->getProperty('arguments');
-        $argumentsProperty->setAccessible(true);
-
         // Assertions
-
-        /** @var Arguments $arguments */
-        $arguments = $argumentsProperty->getValue($this->controller);
+        $arguments = $this->controller->getControllerContext()->getArguments();
         $argument = $arguments->getArgument('bazParam');
 
         /** @var ConjunctionValidator $validator */