[TASK] Make FormViewHelperTest notice free 49/56249/5
authorJan Helke <typo3@helke.de>
Fri, 16 Mar 2018 18:44:50 +0000 (19:44 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 16 Mar 2018 21:21:24 +0000 (22:21 +0100)
Releases: master
Resolves: #84370
Change-Id: I2290665353e844e29fbcd168f21e03260a56fa8c
Reviewed-on: https://review.typo3.org/56249
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
typo3/sysext/fluid/Tests/Unit/ViewHelpers/FormViewHelperTest.php

index 349b356..a51b3ad 100644 (file)
@@ -140,13 +140,13 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
     public function render()
     {
         $this->setFormActionUri();
-        if (strtolower($this->arguments['method']) === 'get') {
+        if (isset($this->arguments['method']) && strtolower($this->arguments['method']) === 'get') {
             $this->tag->addAttribute('method', 'get');
         } else {
             $this->tag->addAttribute('method', 'post');
         }
 
-        if ($this->arguments['novalidate'] === true) {
+        if (isset($this->arguments['novalidate']) && $this->arguments['novalidate'] === true) {
             $this->tag->addAttribute('novalidate', 'novalidate');
         }
 
@@ -156,13 +156,13 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
         $this->addFormFieldNamesToViewHelperVariableContainer();
         $formContent = $this->renderChildren();
 
-        if ($this->arguments['hiddenFieldClassName'] !== null) {
+        if (isset($this->arguments['hiddenFieldClassName']) && $this->arguments['hiddenFieldClassName'] !== null) {
             $content = LF . '<div class="' . htmlspecialchars($this->arguments['hiddenFieldClassName']) . '">';
         } else {
             $content = LF . '<div>';
         }
 
-        $content .= $this->renderHiddenIdentityField($this->arguments['object'], $this->getFormObjectName());
+        $content .= $this->renderHiddenIdentityField($this->arguments['object'] ?? null, $this->getFormObjectName());
         $content .= $this->renderAdditionalIdentityFields();
         $content .= $this->renderHiddenReferrerFields();
 
@@ -188,27 +188,27 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
         if ($this->hasArgument('actionUri')) {
             $formActionUri = $this->arguments['actionUri'];
         } else {
-            $pageUid = (int)$this->arguments['pageUid'] > 0 ? (int)$this->arguments['pageUid'] : null;
+            $pageUid = (isset($this->arguments['pageUid']) && (int)$this->arguments['pageUid'] > 0) ? (int)$this->arguments['pageUid'] : null;
             $uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
             $formActionUri = $uriBuilder
                 ->reset()
                 ->setTargetPageUid($pageUid)
-                ->setTargetPageType($this->arguments['pageType'])
-                ->setNoCache($this->arguments['noCache'])
-                ->setUseCacheHash(!$this->arguments['noCacheHash'])
-                ->setSection($this->arguments['section'])
-                ->setCreateAbsoluteUri($this->arguments['absolute'])
-                ->setArguments((array)$this->arguments['additionalParams'])
-                ->setAddQueryString($this->arguments['addQueryString'])
-                ->setAddQueryStringMethod($this->arguments['addQueryStringMethod'])
-                ->setArgumentsToBeExcludedFromQueryString((array)$this->arguments['argumentsToBeExcludedFromQueryString'])
-                ->setFormat($this->arguments['format'])
+                ->setTargetPageType($this->arguments['pageType'] ?? 0)
+                ->setNoCache($this->arguments['noCache'] ?? false)
+                ->setUseCacheHash(isset($this->arguments['noCacheHash']) ? !$this->arguments['noCacheHash'] : true)
+                ->setSection($this->arguments['section'] ?? '')
+                ->setCreateAbsoluteUri($this->arguments['absolute'] ?? false)
+                ->setArguments(isset($this->arguments['additionalParams']) ? (array)$this->arguments['additionalParams'] : [])
+                ->setAddQueryString($this->arguments['addQueryString'] ?? false)
+                ->setAddQueryStringMethod($this->arguments['addQueryStringMethod'] ?? null)
+                ->setArgumentsToBeExcludedFromQueryString(isset($this->arguments['argumentsToBeExcludedFromQueryString']) ? (array)$this->arguments['argumentsToBeExcludedFromQueryString'] : [])
+                ->setFormat($this->arguments['format'] ?? '')
                 ->uriFor(
-                    $this->arguments['action'],
-                    $this->arguments['arguments'],
-                    $this->arguments['controller'],
-                    $this->arguments['extensionName'],
-                    $this->arguments['pluginName']
+                    $this->arguments['action'] ?? null,
+                    $this->arguments['arguments'] ?? [],
+                    $this->arguments['controller'] ?? null,
+                    $this->arguments['extensionName'] ?? null,
+                    $this->arguments['pluginName'] ?? null
                 );
             $this->formActionUriArguments = $uriBuilder->getArguments();
         }
index 623fe0f..6478fb7 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
 
 /*
@@ -14,8 +15,12 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
+use TYPO3\CMS\Extbase\Security\Cryptography\HashService;
+use TYPO3\CMS\Extbase\Service\ExtensionService;
 use TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper;
 use TYPO3\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
+use TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder;
 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface;
 
 /**
@@ -24,26 +29,21 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface;
 class FormViewHelperTest extends ViewHelperBaseTestcase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
-     * @var \TYPO3\CMS\Extbase\Service\ExtensionService
+     * @var ExtensionService
      */
     protected $mockExtensionService;
 
     /**
-     * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
+     * @var ConfigurationManagerInterface
      */
     protected $mockConfigurationManager;
 
     protected function setUp()
     {
         parent::setUp();
-        $this->mockExtensionService = $this->createMock(\TYPO3\CMS\Extbase\Service\ExtensionService::class);
-        $this->mockConfigurationManager = $this->createMock(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
-        $this->tagBuilder = $this->createMock(\TYPO3Fluid\Fluid\Core\ViewHelper\TagBuilder::class);
+        $this->mockExtensionService = $this->createMock(ExtensionService::class);
+        $this->mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
+        $this->tagBuilder = $this->createMock(TagBuilder::class);
     }
 
     /**
@@ -87,7 +87,7 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     {
         $viewHelper->_set('configurationManager', $this->mockConfigurationManager);
         parent::injectDependenciesIntoViewHelper($viewHelper);
-        $hashService = $this->getMockBuilder(\TYPO3\CMS\Extbase\Security\Cryptography\HashService::class)
+        $hashService = $this->getMockBuilder(HashService::class)
             ->setMethods(['appendHmac'])
             ->getMock();
         $hashService->expects($this->any())->method('appendHmac')->will($this->returnValue(''));
@@ -102,13 +102,13 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     public function renderAddsObjectToViewHelperVariableContainer()
     {
         $formObject = new \stdClass();
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderHiddenSecuredReferrerField', 'renderRequestHashField', 'addFormObjectNameToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectNameFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderHiddenSecuredReferrerField', 'renderRequestHashField', 'addFormObjectNameToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectNameFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->setArguments(['object' => $formObject]);
-        $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject', $formObject);
-        $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties', []);
-        $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObject');
-        $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties');
+        $this->viewHelperVariableContainer->add(FormViewHelper::class, 'formObject', $formObject);
+        $this->viewHelperVariableContainer->add(FormViewHelper::class, 'additionalIdentityProperties', []);
+        $this->viewHelperVariableContainer->remove(FormViewHelper::class, 'formObject');
+        $this->viewHelperVariableContainer->remove(FormViewHelper::class, 'additionalIdentityProperties');
         $viewHelper->_set('tag', $this->tagBuilder);
         $viewHelper->render();
     }
@@ -119,11 +119,11 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     public function renderAddsObjectNameToTemplateVariableContainer()
     {
         $objectName = 'someObjectName';
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderHiddenSecuredReferrerField', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderHiddenSecuredReferrerField', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->setArguments(['name' => $objectName]);
-        $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName', $objectName);
-        $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
+        $this->viewHelperVariableContainer->add(FormViewHelper::class, 'formObjectName', $objectName);
+        $this->viewHelperVariableContainer->remove(FormViewHelper::class, 'formObjectName');
         $viewHelper->_set('tag', $this->tagBuilder);
         $viewHelper->render();
     }
@@ -134,11 +134,11 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     public function formObjectNameArgumentOverrulesNameArgument()
     {
         $objectName = 'someObjectName';
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormObjectToViewHelperVariableContainer', 'addFieldNamePrefixToViewHelperVariableContainer', 'removeFormObjectFromViewHelperVariableContainer', 'removeFieldNamePrefixFromViewHelperVariableContainer', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->setArguments(['name' => 'formName', 'objectName' => $objectName]);
-        $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName', $objectName);
-        $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'formObjectName');
+        $this->viewHelperVariableContainer->add(FormViewHelper::class, 'formObjectName', $objectName);
+        $this->viewHelperVariableContainer->remove(FormViewHelper::class, 'formObjectName');
         $viewHelper->_set('tag', $this->tagBuilder);
         $viewHelper->render();
     }
@@ -148,7 +148,7 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
      */
     public function renderCallsRenderHiddenReferrerFields()
     {
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderTrustedPropertiesField'], [], '', false);
         $viewHelper->expects($this->once())->method('renderHiddenReferrerFields');
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->_set('tag', $this->tagBuilder);
@@ -161,7 +161,7 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     public function renderCallsRenderHiddenIdentityField()
     {
         $object = new \stdClass();
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderHiddenIdentityField', 'getFormObjectName', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderHiddenIdentityField', 'getFormObjectName', 'renderTrustedPropertiesField'], [], '', false);
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->setArguments(['object' => $object]);
         $viewHelper->expects($this->atLeastOnce())->method('getFormObjectName')->will($this->returnValue('MyName'));
@@ -175,7 +175,7 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
      */
     public function renderCallsRenderAdditionalIdentityFields()
     {
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderAdditionalIdentityFields', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderRequestHashField', 'renderHiddenReferrerFields', 'renderAdditionalIdentityFields', 'renderTrustedPropertiesField'], [], '', false);
         $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields');
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->_set('tag', $this->tagBuilder);
@@ -187,15 +187,15 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
      */
     public function renderWrapsHiddenFieldsWithDivForXhtmlCompatibilityWithRewrittenPropertyMapper()
     {
-        $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class), ['renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderHiddenSecuredReferrerField', 'renderTrustedPropertiesField'], [], '', false);
-        $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+        $viewHelper = $this->getAccessibleMock($this->buildAccessibleProxy(FormViewHelper::class), ['renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderHiddenSecuredReferrerField', 'renderTrustedPropertiesField'], [], '', false);
+        $this->mvcPropertyMapperConfigurationService->_set('hashService', new HashService());
         $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
         parent::injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField'));
         $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields'));
         $viewHelper->expects($this->once())->method('renderHiddenReferrerFields')->will($this->returnValue('hiddenReferrerFields'));
         $viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('formContent'));
-        $expectedResult = chr(10) . '<div>' . 'hiddenIdentityFieldadditionalIdentityFieldshiddenReferrerFields' . chr(10) . '</div>' . chr(10) . 'formContent';
+        $expectedResult =  \chr(10) . '<div>' . 'hiddenIdentityFieldadditionalIdentityFieldshiddenReferrerFields' . \chr(10) . '</div>' . \chr(10) . 'formContent';
         $this->tagBuilder->expects($this->once())->method('setContent')->with($expectedResult);
         $viewHelper->_set('tag', $this->tagBuilder);
         $viewHelper->render();
@@ -206,18 +206,18 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
      */
     public function renderWrapsHiddenFieldsWithDivAndAnAdditionalClassForXhtmlCompatibilityWithRewrittenPropertyMapper()
     {
-        $viewHelper = $this->getMockBuilder($this->buildAccessibleProxy(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class))
+        $viewHelper = $this->getMockBuilder($this->buildAccessibleProxy(FormViewHelper::class))
             ->setMethods(['renderChildren', 'renderHiddenIdentityField', 'renderAdditionalIdentityFields', 'renderHiddenReferrerFields', 'renderHiddenSecuredReferrerField', 'renderTrustedPropertiesField'])
             ->disableOriginalConstructor()
             ->getMock();
-        $this->mvcPropertyMapperConfigurationService->_set('hashService', new \TYPO3\CMS\Extbase\Security\Cryptography\HashService());
+        $this->mvcPropertyMapperConfigurationService->_set('hashService', new HashService());
         $viewHelper->_set('mvcPropertyMapperConfigurationService', $this->mvcPropertyMapperConfigurationService);
         parent::injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->expects($this->once())->method('renderHiddenIdentityField')->will($this->returnValue('hiddenIdentityField'));
         $viewHelper->expects($this->once())->method('renderAdditionalIdentityFields')->will($this->returnValue('additionalIdentityFields'));
         $viewHelper->expects($this->once())->method('renderHiddenReferrerFields')->will($this->returnValue('hiddenReferrerFields'));
         $viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('formContent'));
-        $expectedResult = chr(10) . '<div class="hidden">' . 'hiddenIdentityFieldadditionalIdentityFieldshiddenReferrerFields' . chr(10) . '</div>' . chr(10) . 'formContent';
+        $expectedResult =  \chr(10) . '<div class="hidden">' . 'hiddenIdentityFieldadditionalIdentityFieldshiddenReferrerFields' . \chr(10) . '</div>' . \chr(10) . 'formContent';
         $this->tagBuilder->expects($this->once())->method('setContent')->with($expectedResult);
         $viewHelper->setArguments(['hiddenFieldClassName' => 'hidden']);
         $viewHelper->_set('tag', $this->tagBuilder);
@@ -233,11 +233,11 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
             'object1[object2]' => '<input type="hidden" name="object1[object2][__identity]" value="42" />',
             'object1[object2][subobject]' => '<input type="hidden" name="object1[object2][subobject][__identity]" value="21" />'
         ];
-        $this->viewHelperVariableContainer->exists(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties')->willReturn(true);
-        $this->viewHelperVariableContainer->get(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'additionalIdentityProperties')->willReturn($identityProperties);
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren'], [], '', false);
+        $this->viewHelperVariableContainer->exists(FormViewHelper::class, 'additionalIdentityProperties')->willReturn(true);
+        $this->viewHelperVariableContainer->get(FormViewHelper::class, 'additionalIdentityProperties')->willReturn($identityProperties);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren'], [], '', false);
         $this->injectDependenciesIntoViewHelper($viewHelper);
-        $expected = chr(10) . '<input type="hidden" name="object1[object2][__identity]" value="42" />' . chr(10) . '<input type="hidden" name="object1[object2][subobject][__identity]" value="21" />';
+        $expected =  \chr(10) . '<input type="hidden" name="object1[object2][__identity]" value="42" />' . \chr(10) . '<input type="hidden" name="object1[object2][subobject][__identity]" value="21" />';
         $actual = $viewHelper->_call('renderAdditionalIdentityFields');
         $viewHelper->_set('tag', $this->tagBuilder);
         $this->assertEquals($expected, $actual);
@@ -248,7 +248,7 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
      */
     public function renderHiddenReferrerFieldsAddCurrentControllerAndActionAsHiddenFields()
     {
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['dummy'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['dummy'], [], '', false);
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $this->request->getControllerExtensionName()->willReturn('extensionName');
         $this->request->getControllerName()->willReturn('controllerName');
@@ -256,12 +256,12 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
         $this->request->getControllerVendorName()->willReturn('controllerVendorName');
         $this->request->getArguments()->willReturn([]);
         $hiddenFields = $viewHelper->_call('renderHiddenReferrerFields');
-        $expectedResult = chr(10) . '<input type="hidden" name="__referrer[@extension]" value="extensionName" />'
-            . chr(10) . '<input type="hidden" name="__referrer[@vendor]" value="controllerVendorName" />'
-            . chr(10) . '<input type="hidden" name="__referrer[@controller]" value="controllerName" />'
-            . chr(10) . '<input type="hidden" name="__referrer[@action]" value="controllerActionName" />'
-            . chr(10) . '<input type="hidden" name="__referrer[arguments]" value="" />'
-            . chr(10) . '<input type="hidden" name="__referrer[@request]" value="" />' . chr(10);
+        $expectedResult =  \chr(10) . '<input type="hidden" name="__referrer[@extension]" value="extensionName" />'
+            . \chr(10) . '<input type="hidden" name="__referrer[@vendor]" value="controllerVendorName" />'
+            . \chr(10) . '<input type="hidden" name="__referrer[@controller]" value="controllerName" />'
+            . \chr(10) . '<input type="hidden" name="__referrer[@action]" value="controllerActionName" />'
+            . \chr(10) . '<input type="hidden" name="__referrer[arguments]" value="" />'
+            . \chr(10) . '<input type="hidden" name="__referrer[@request]" value="" />' . \chr(10);
         $viewHelper->_set('tag', $this->tagBuilder);
         $this->assertEquals($expectedResult, $hiddenFields);
     }
@@ -272,11 +272,11 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     public function renderAddsSpecifiedPrefixToTemplateVariableContainer()
     {
         $prefix = 'somePrefix';
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->setArguments(['fieldNamePrefix' => $prefix]);
-        $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix', $prefix);
-        $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix');
+        $this->viewHelperVariableContainer->add(FormViewHelper::class, 'fieldNamePrefix', $prefix);
+        $this->viewHelperVariableContainer->remove(FormViewHelper::class, 'fieldNamePrefix');
         $viewHelper->_set('tag', $this->tagBuilder);
         $viewHelper->render();
     }
@@ -287,13 +287,13 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     public function renderAddsDefaultFieldNamePrefixToTemplateVariableContainerIfNoPrefixIsSpecified()
     {
         $expectedPrefix = 'tx_someextension_someplugin';
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['renderChildren', 'renderHiddenIdentityField', 'renderHiddenReferrerFields', 'renderRequestHashField', 'addFormFieldNamesToViewHelperVariableContainer', 'removeFormFieldNamesFromViewHelperVariableContainer', 'renderTrustedPropertiesField'], [], '', false);
         $this->mockExtensionService->expects($this->once())->method('getPluginNamespace')->with('SomeExtension', 'SomePlugin')->will($this->returnValue('tx_someextension_someplugin'));
         $viewHelper->_set('extensionService', $this->mockExtensionService);
         $this->injectDependenciesIntoViewHelper($viewHelper);
         $viewHelper->setArguments(['extensionName' => 'SomeExtension', 'pluginName' => 'SomePlugin']);
-        $this->viewHelperVariableContainer->add(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix', $expectedPrefix);
-        $this->viewHelperVariableContainer->remove(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, 'fieldNamePrefix');
+        $this->viewHelperVariableContainer->add(FormViewHelper::class, 'fieldNamePrefix', $expectedPrefix);
+        $this->viewHelperVariableContainer->remove(FormViewHelper::class, 'fieldNamePrefix');
         $viewHelper->_set('tag', $this->tagBuilder);
         $viewHelper->render();
     }
@@ -301,7 +301,7 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     /**
      * Data Provider for postProcessUriArgumentsForRequestHashWorks
      */
-    public function argumentsForPostProcessUriArgumentsForRequestHash()
+    public function argumentsForPostProcessUriArgumentsForRequestHash(): array
     {
         return [
             // simple values
@@ -336,10 +336,12 @@ class FormViewHelperTest extends ViewHelperBaseTestcase
     /**
      * @test
      * @dataProvider argumentsForPostProcessUriArgumentsForRequestHash
+     * @param $arguments
+     * @param $expectedResults
      */
     public function postProcessUriArgumentsForRequestHashWorks($arguments, $expectedResults)
     {
-        $viewHelper = $this->getAccessibleMock(\TYPO3\CMS\Fluid\ViewHelpers\FormViewHelper::class, ['dummy'], [], '', false);
+        $viewHelper = $this->getAccessibleMock(FormViewHelper::class, ['dummy'], [], '', false);
         $results = [];
         $viewHelper->_callRef('postProcessUriArgumentsForRequestHash', $arguments, $results);
         $this->assertEquals($expectedResults, $results);