[TASK] Make core/Tests/Unit/Configuration notice free 59/56659/8
authorJan Helke <typo3@helke.de>
Sat, 14 Apr 2018 14:23:35 +0000 (16:23 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 9 Jun 2018 19:56:30 +0000 (21:56 +0200)
Releases: master
Resolves: #84722
Change-Id: I0edb98c7713f5c6520cbbc33e3f85ab1b3f4946f
Reviewed-on: https://review.typo3.org/56659
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/core/Classes/Configuration/FlexForm/FlexFormTools.php
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php
typo3/sysext/core/Tests/Unit/Configuration/FlexForm/FlexFormToolsTest.php

index 5f33c73..b7d239d 100644 (file)
@@ -4073,7 +4073,7 @@ class BackendUtility
     public static function getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields = '*')
     {
         if (ExtensionManagementUtility::isLoaded('workspaces')) {
-            if ($workspace !== 0 && $GLOBALS['TCA'][$table] && self::isTableWorkspaceEnabled($table)) {
+            if ($workspace !== 0 && self::isTableWorkspaceEnabled($table)) {
 
                 // Select workspace version of record:
                 $queryBuilder = static::getQueryBuilderForTable($table);
index d300a34..80fefa1 100644 (file)
@@ -820,53 +820,55 @@ class FlexFormTools
      * @param array $editData (Part of) edit data array, reflecting current part of data structure
      * @param array $PA Additional parameters passed.
      * @param string $path Telling the "path" to the element in the flexform XML
-     * @return array
      */
-    public function traverseFlexFormXMLData_recurse($dataStruct, $editData, &$PA, $path = '')
+    public function traverseFlexFormXMLData_recurse($dataStruct, $editData, &$PA, $path = ''): void
     {
         if (is_array($dataStruct)) {
             foreach ($dataStruct as $key => $value) {
-                // The value of each entry must be an array.
-                if (is_array($value)) {
-                    if ($value['type'] === 'array') {
-                        // Array (Section) traversal
-                        if ($value['section']) {
-                            $cc = 0;
-                            if (is_array($editData[$key]['el'])) {
-                                if ($this->reNumberIndexesOfSectionData) {
-                                    $temp = [];
-                                    $c3 = 0;
-                                    foreach ($editData[$key]['el'] as $v3) {
-                                        $temp[++$c3] = $v3;
-                                    }
-                                    $editData[$key]['el'] = $temp;
+                if (isset($value['type']) && $value['type'] === 'array') {
+                    // Array (Section) traversal
+                    if ($value['section']) {
+                        $cc = 0;
+                        if (isset($editData[$key]['el']) && is_array($editData[$key]['el'])) {
+                            if ($this->reNumberIndexesOfSectionData) {
+                                $temp = [];
+                                $c3 = 0;
+                                foreach ($editData[$key]['el'] as $v3) {
+                                    $temp[++$c3] = $v3;
                                 }
-                                foreach ($editData[$key]['el'] as $k3 => $v3) {
-                                    if (is_array($v3)) {
-                                        $cc = $k3;
-                                        $theType = key($v3);
-                                        $theDat = $v3[$theType];
-                                        $newSectionEl = $value['el'][$theType];
-                                        if (is_array($newSectionEl)) {
-                                            $this->traverseFlexFormXMLData_recurse([$theType => $newSectionEl], [$theType => $theDat], $PA, $path . '/' . $key . '/el/' . $cc);
-                                        }
+                                $editData[$key]['el'] = $temp;
+                            }
+                            foreach ($editData[$key]['el'] as $k3 => $v3) {
+                                if (is_array($v3)) {
+                                    $cc = $k3;
+                                    $theType = key($v3);
+                                    $theDat = $v3[$theType];
+                                    $newSectionEl = $value['el'][$theType];
+                                    if (is_array($newSectionEl)) {
+                                        $this->traverseFlexFormXMLData_recurse([$theType => $newSectionEl], [$theType => $theDat], $PA, $path . '/' . $key . '/el/' . $cc);
                                     }
                                 }
                             }
-                        } else {
-                            // Array traversal
-                            if (is_array($editData) && is_array($editData[$key])) {
-                                $this->traverseFlexFormXMLData_recurse($value['el'], $editData[$key]['el'], $PA, $path . '/' . $key . '/el');
-                            }
                         }
-                    } elseif (is_array($value['TCEforms']['config'])) {
-                        // Processing a field value:
-                        foreach ($PA['vKeys'] as $vKey) {
-                            $vKey = 'v' . $vKey;
-                            // Call back
-                            if ($PA['callBackMethod_value'] && is_array($editData) && is_array($editData[$key])) {
-                                $this->executeCallBackMethod($PA['callBackMethod_value'], [$value, $editData[$key][$vKey], $PA, $path . '/' . $key . '/' . $vKey, $this]);
-                            }
+                    } else {
+                        // Array traversal
+                        if (isset($editData[$key]['el'])) {
+                            $this->traverseFlexFormXMLData_recurse($value['el'], $editData[$key]['el'], $PA, $path . '/' . $key . '/el');
+                        }
+                    }
+                } elseif (isset($value['TCEforms']['config']) && is_array($value['TCEforms']['config'])) {
+                    // Processing a field value:
+                    foreach ($PA['vKeys'] as $vKey) {
+                        $vKey = 'v' . $vKey;
+                        // Call back
+                        if (!empty($PA['callBackMethod_value']) && isset($editData[$key][$vKey])) {
+                            $this->executeCallBackMethod($PA['callBackMethod_value'], [
+                                $value,
+                                $editData[$key][$vKey],
+                                $PA,
+                                $path . '/' . $key . '/' . $vKey,
+                                $this
+                            ]);
                         }
                     }
                 }
index fe0d240..dde5351 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+declare(strict_types = 1);
+
 namespace TYPO3\CMS\Core\Tests\Unit\Configuration;
 
 /*
@@ -14,22 +16,20 @@ namespace TYPO3\CMS\Core\Tests\Unit\Configuration;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Core\Configuration\ConfigurationManager;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
+
 /**
  * Test case
  */
-class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class ConfigurationManagerTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
-     * @var \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject
+     * @var ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject
      */
     protected $subject;
 
-    protected function setUp()
+    protected function setUp(): void
     {
         $this->createSubjectWithMockedMethods(
             [
@@ -42,9 +42,9 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @param array $methods
      */
-    protected function createSubjectWithMockedMethods(array $methods)
+    protected function createSubjectWithMockedMethods(array $methods): void
     {
-        $this->subject = $this->getMockBuilder(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class)
+        $this->subject = $this->getMockBuilder(ConfigurationManager::class)
             ->setMethods($methods)
             ->getMock();
     }
@@ -52,7 +52,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function getDefaultConfigurationExecutesDefinedDefaultConfigurationFile()
+    public function getDefaultConfigurationExecutesDefinedDefaultConfigurationFile(): void
     {
         $this->expectException(\RuntimeException::class);
         $this->expectExceptionCode(1310203814);
@@ -74,7 +74,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function getLocalConfigurationExecutesDefinedConfigurationFile()
+    public function getLocalConfigurationExecutesDefinedConfigurationFile(): void
     {
         $this->expectException(\RuntimeException::class);
 
@@ -95,7 +95,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function updateLocalConfigurationWritesNewMergedLocalConfigurationArray()
+    public function updateLocalConfigurationWritesNewMergedLocalConfigurationArray(): void
     {
         $currentLocalConfiguration = [
             'notChanged' => 23,
@@ -118,11 +118,11 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
             ]
         );
         $this->subject->expects($this->once())
-                ->method('getLocalConfiguration')
-                ->will($this->returnValue($currentLocalConfiguration));
+            ->method('getLocalConfiguration')
+            ->will($this->returnValue($currentLocalConfiguration));
         $this->subject->expects($this->once())
-                ->method('writeLocalConfiguration')
-                ->with($expectedConfiguration);
+            ->method('writeLocalConfiguration')
+            ->with($expectedConfiguration);
 
         $this->subject->updateLocalConfiguration($overrideConfiguration);
     }
@@ -130,7 +130,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function getDefaultConfigurationValueByPathReturnsCorrectValue()
+    public function getDefaultConfigurationValueByPathReturnsCorrectValue(): void
     {
         $this->createSubjectWithMockedMethods(
             [
@@ -138,9 +138,9 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
             ]
         );
         $this->subject->expects($this->once())
-                ->method('getDefaultConfiguration')
-                ->will($this->returnValue(
-                    [
+            ->method('getDefaultConfiguration')
+            ->will($this->returnValue(
+                [
                     'path' => 'value',
                 ]
             ));
@@ -151,7 +151,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function getLocalConfigurationValueByPathReturnsCorrectValue()
+    public function getLocalConfigurationValueByPathReturnsCorrectValue(): void
     {
         $this->createSubjectWithMockedMethods(
             [
@@ -159,9 +159,9 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
             ]
         );
         $this->subject->expects($this->once())
-                ->method('getLocalConfiguration')
-                ->will($this->returnValue(
-                    [
+            ->method('getLocalConfiguration')
+            ->will($this->returnValue(
+                [
                     'path' => 'value',
                 ]
             ));
@@ -172,7 +172,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function getConfigurationValueByPathReturnsCorrectValue()
+    public function getConfigurationValueByPathReturnsCorrectValue(): void
     {
         $this->createSubjectWithMockedMethods(
             [
@@ -181,16 +181,16 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
             ]
         );
         $this->subject->expects($this->once())
-                ->method('getDefaultConfiguration')
-                ->will($this->returnValue(
-                    [
+            ->method('getDefaultConfiguration')
+            ->will($this->returnValue(
+                [
                     'path' => 'value',
                 ]
             ));
         $this->subject->expects($this->once())
-                ->method('getLocalConfiguration')
-                ->will($this->returnValue(
-                    [
+            ->method('getLocalConfiguration')
+            ->will($this->returnValue(
+                [
                     'path' => 'valueOverride',
                 ]
             ));
@@ -201,14 +201,14 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function setLocalConfigurationValueByPathReturnFalseIfPathIsNotValid()
+    public function setLocalConfigurationValueByPathReturnFalseIfPathIsNotValid(): void
     {
         $this->createSubjectWithMockedMethods([
-                'isValidLocalConfigurationPath',
-            ]);
+            'isValidLocalConfigurationPath',
+        ]);
         $this->subject->expects($this->once())
-                ->method('isValidLocalConfigurationPath')
-                ->will($this->returnValue(false));
+            ->method('isValidLocalConfigurationPath')
+            ->will($this->returnValue(false));
 
         $this->assertFalse($this->subject->setLocalConfigurationValueByPath('path', 'value'));
     }
@@ -216,7 +216,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function setLocalConfigurationValueByPathUpdatesValueDefinedByPath()
+    public function setLocalConfigurationValueByPathUpdatesValueDefinedByPath(): void
     {
         $currentLocalConfiguration = [
             'notChanged' => 23,
@@ -235,14 +235,14 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
             ]
         );
         $this->subject->expects($this->once())
-                ->method('isValidLocalConfigurationPath')
-                ->will($this->returnValue(true));
+            ->method('isValidLocalConfigurationPath')
+            ->will($this->returnValue(true));
         $this->subject->expects($this->once())
-                ->method('getLocalConfiguration')
-                ->will($this->returnValue($currentLocalConfiguration));
+            ->method('getLocalConfiguration')
+            ->will($this->returnValue($currentLocalConfiguration));
         $this->subject->expects($this->once())
-                ->method('writeLocalConfiguration')
-                ->with($expectedConfiguration);
+            ->method('writeLocalConfiguration')
+            ->with($expectedConfiguration);
 
         $this->subject->setLocalConfigurationValueByPath('toUpdate', 'updated');
     }
@@ -250,7 +250,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function setLocalConfigurationValuesByPathValuePairsSetsPathValuePairs()
+    public function setLocalConfigurationValuesByPathValuePairsSetsPathValuePairs(): void
     {
         $currentLocalConfiguration = [
             'notChanged' => 23,
@@ -270,14 +270,14 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
             ]
         );
         $this->subject->expects($this->any())
-                ->method('isValidLocalConfigurationPath')
-                ->will($this->returnValue(true));
+            ->method('isValidLocalConfigurationPath')
+            ->will($this->returnValue(true));
         $this->subject->expects($this->once())
-                ->method('getLocalConfiguration')
-                ->will($this->returnValue($currentLocalConfiguration));
+            ->method('getLocalConfiguration')
+            ->will($this->returnValue($currentLocalConfiguration));
         $this->subject->expects($this->once())
-                ->method('writeLocalConfiguration')
-                ->with($expectedConfiguration);
+            ->method('writeLocalConfiguration')
+            ->with($expectedConfiguration);
 
         $pairs = [
             'toUpdate' => 'updated',
@@ -289,7 +289,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function removeLocalConfigurationKeysByPathRemovesGivenPathsFromConfigurationAndReturnsTrue()
+    public function removeLocalConfigurationKeysByPathRemovesGivenPathsFromConfigurationAndReturnsTrue(): void
     {
         $currentLocalConfiguration = [
             'toRemove1' => 'foo',
@@ -323,7 +323,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function removeLocalConfigurationKeysByPathReturnsFalseIfNothingIsRemoved()
+    public function removeLocalConfigurationKeysByPathReturnsFalseIfNothingIsRemoved(): void
     {
         $currentLocalConfiguration = [
             'notChanged' => 23,
@@ -347,7 +347,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function removeLocalConfigurationKeysByPathReturnsFalseIfSomethingInexistentIsRemoved()
+    public function removeLocalConfigurationKeysByPathReturnsFalseIfSomethingInexistentIsRemoved(): void
     {
         $currentLocalConfiguration = [
             'notChanged' => 23,
@@ -371,13 +371,13 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function canWriteConfigurationReturnsFalseIfLocalConfigurationFileIsNotWritable()
+    public function canWriteConfigurationReturnsFalseIfLocalConfigurationFileIsNotWritable(): void
     {
-        if (function_exists('posix_getegid') && posix_getegid() === 0) {
+        if (\function_exists('posix_getegid') && posix_getegid() === 0) {
             $this->markTestSkipped('Test skipped if run on linux as root');
         }
-        /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
-        $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, ['dummy']);
+        /** @var $subject ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $subject = $this->getAccessibleMock(ConfigurationManager::class, ['dummy']);
 
         $file = 'typo3temp/var/tests/' . $this->getUniqueId('test_');
         $absoluteFile = PATH_site . $file;
@@ -398,10 +398,10 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function canWriteConfigurationReturnsTrueIfDirectoryAndFilesAreWritable()
+    public function canWriteConfigurationReturnsTrueIfDirectoryAndFilesAreWritable(): void
     {
-        /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
-        $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, ['dummy']);
+        /** @var $subject ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $subject = $this->getAccessibleMock(ConfigurationManager::class, ['dummy']);
 
         $directory = 'typo3temp/var/tests/' . $this->getUniqueId('test_');
         $absoluteDirectory = PATH_site . $directory;
@@ -424,7 +424,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function writeLocalConfigurationWritesSortedContentToConfigurationFile()
+    public function writeLocalConfigurationWritesSortedContentToConfigurationFile(): void
     {
         $configurationFile = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('localConfiguration');
         if (!is_file($configurationFile)) {
@@ -435,7 +435,10 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
         }
 
         if (!@is_file($configurationFile)) {
-            throw new \RuntimeException('File ' . $configurationFile . ' could not be found. Please check your write permissions', 1346364362);
+            throw new \RuntimeException(
+                'File ' . $configurationFile . ' could not be found. Please check your write permissions',
+                1346364362
+            );
         }
         $this->testFilesToDelete[] = $configurationFile;
 
@@ -450,10 +453,10 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
         ];
         $expectedContent =
             '<?php' . LF .
-                'return [' . LF .
-                    '    \'bar\' => 23,' . LF .
-                    '    \'foo\' => 42,' . LF .
-                '];' . LF;
+            'return [' . LF .
+            '    \'bar\' => 23,' . LF .
+            '    \'foo\' => 42,' . LF .
+            '];' . LF;
 
         $this->subject->writeLocalConfiguration($pairs);
         $this->assertSame($expectedContent, file_get_contents($configurationFile));
@@ -462,12 +465,12 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function createLocalConfigurationFromFactoryConfigurationThrowsExceptionIfFileExists()
+    public function createLocalConfigurationFromFactoryConfigurationThrowsExceptionIfFileExists(): void
     {
         $this->expectException(\RuntimeException::class);
 
-        /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
-        $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, ['dummy']);
+        /** @var $subject ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $subject = $this->getAccessibleMock(ConfigurationManager::class, ['dummy']);
 
         $file = 'typo3temp/var/tests/' . $this->getUniqueId('test_');
         $absoluteFile = PATH_site . $file;
@@ -481,10 +484,10 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function createLocalConfigurationFromFactoryConfigurationWritesContentFromFactoryFile()
+    public function createLocalConfigurationFromFactoryConfigurationWritesContentFromFactoryFile(): void
     {
-        /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
-        $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, ['writeLocalConfiguration']);
+        /** @var $subject ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $subject = $this->getAccessibleMock(ConfigurationManager::class, ['writeLocalConfiguration']);
         $subject->_set('localConfigurationFile', 'typo3temp/var/tests/' . $this->getUniqueId('dummy_'));
 
         $factoryConfigurationFile = 'typo3temp/var/tests/' . $this->getUniqueId('test_') . '.php';
@@ -492,9 +495,9 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
         $uniqueContentString = $this->getUniqueId('string_');
         $validFactoryConfigurationFileContent =
             '<?php' . LF .
-                'return [' . LF .
-                    '\'' . $uniqueContentString . '\' => \'foo\',' . LF .
-                '];' . LF;
+            'return [' . LF .
+            '\'' . $uniqueContentString . '\' => \'foo\',' . LF .
+            '];' . LF;
         file_put_contents(
             $factoryConfigurationAbsoluteFile,
             $validFactoryConfigurationFileContent
@@ -513,17 +516,17 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function createLocalConfigurationFromFactoryConfigurationMergesConfigurationWithAdditionalFactoryFile()
+    public function createLocalConfigurationFromFactoryConfigurationMergesConfigurationWithAdditionalFactoryFile(): void
     {
-        /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
-        $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, ['writeLocalConfiguration']);
+        /** @var $subject ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $subject = $this->getAccessibleMock(ConfigurationManager::class, ['writeLocalConfiguration']);
         $subject->_set('localConfigurationFile', 'typo3temp/var/tests/' . $this->getUniqueId('dummy_'));
 
         $factoryConfigurationFile = 'typo3temp/var/tests/' . $this->getUniqueId('test_') . '.php';
         $factoryConfigurationAbsoluteFile = PATH_site . $factoryConfigurationFile;
         $validFactoryConfigurationFileContent =
             '<?php' . LF .
-                'return [];' . LF;
+            'return [];' . LF;
         file_put_contents(
             $factoryConfigurationAbsoluteFile,
             $validFactoryConfigurationFileContent
@@ -536,9 +539,9 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
         $uniqueContentString = $this->getUniqueId('string_');
         $validAdditionalFactoryConfigurationFileContent =
             '<?php' . LF .
-                'return [' . LF .
-                    '\'' . $uniqueContentString . '\' => \'foo\',' . LF .
-                '];' . LF;
+            'return [' . LF .
+            '\'' . $uniqueContentString . '\' => \'foo\',' . LF .
+            '];' . LF;
         file_put_contents(
             $additionalFactoryConfigurationAbsoluteFile,
             $validAdditionalFactoryConfigurationFileContent
@@ -556,10 +559,10 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function isValidLocalConfigurationPathAcceptsWhitelistedPath()
+    public function isValidLocalConfigurationPathAcceptsWhitelistedPath(): void
     {
-        /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
-        $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, ['dummy']);
+        /** @var $subject ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $subject = $this->getAccessibleMock(ConfigurationManager::class, ['dummy']);
         $subject->_set('whiteListedLocalConfigurationPaths', ['foo/bar']);
         $this->assertTrue($subject->_call('isValidLocalConfigurationPath', 'foo/bar/baz'));
     }
@@ -567,10 +570,10 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
     /**
      * @test
      */
-    public function isValidLocalConfigurationPathDeniesNotWhitelistedPath()
+    public function isValidLocalConfigurationPathDeniesNotWhitelistedPath(): void
     {
-        /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
-        $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, ['dummy']);
+        /** @var $subject ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */
+        $subject = $this->getAccessibleMock(ConfigurationManager::class, ['dummy']);
         $subject->_set('whiteListedLocalConfigurationPaths', ['foo/bar']);
         $this->assertFalse($subject->_call('isValidLocalConfigurationPath', 'bar/baz'));
     }
index 8b3b503..1c4a6d6 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Configuration\FlexForm;
 
 use Doctrine\DBAL\Driver\Statement;
 use Prophecy\Argument;
+use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Configuration\FlexForm\Exception\InvalidCombinedPointerFieldException;
 use TYPO3\CMS\Core\Configuration\FlexForm\Exception\InvalidIdentifierException;
 use TYPO3\CMS\Core\Configuration\FlexForm\Exception\InvalidParentRowException;
@@ -46,21 +47,17 @@ use TYPO3\CMS\Core\Tests\Unit\Configuration\FlexForm\Fixtures\DataStructureParse
 use TYPO3\CMS\Core\Tests\Unit\Configuration\FlexForm\Fixtures\DataStructureParsePreProcessHookReturnString;
 use TYPO3\CMS\Core\Tests\Unit\Configuration\FlexForm\Fixtures\DataStructureParsePreProcessHookThrowException;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Test case
  */
-class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class FlexFormToolsTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @test
      */
-    public function getDataStructureIdentifierCallsRegisteredPreProcessHook()
+    public function getDataStructureIdentifierCallsRegisteredPreProcessHook(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureIdentifierPreProcessHookThrowException::class,
@@ -73,7 +70,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPreProcessHookReturnsNoArray()
+    public function getDataStructureIdentifierThrowsExceptionIfPreProcessHookReturnsNoArray(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureIdentifierPreProcessHookReturnString::class
@@ -86,7 +83,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierUsesCasualLogicIfPreProcessHookReturnsNoIdentifier()
+    public function getDataStructureIdentifierUsesCasualLogicIfPreProcessHookReturnsNoIdentifier(): void
     {
         $fieldTca = [
             'config' => [
@@ -105,7 +102,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsStringFromPreProcessHook()
+    public function getDataStructureIdentifierReturnsStringFromPreProcessHook(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureIdentifierPreProcessHookReturnArray::class
@@ -117,7 +114,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsStringFromFirstMatchingPreProcessHook()
+    public function getDataStructureIdentifierReturnsStringFromFirstMatchingPreProcessHook(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureIdentifierPreProcessHookReturnEmptyArray::class,
@@ -131,7 +128,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierCallsRegisteredPostProcessHook()
+    public function getDataStructureIdentifierCallsRegisteredPostProcessHook(): void
     {
         $fieldTca = [
             'config' => [
@@ -151,7 +148,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPostProcessHookReturnsNoArray()
+    public function getDataStructureIdentifierThrowsExceptionIfPostProcessHookReturnsNoArray(): void
     {
         $fieldTca = [
             'config' => [
@@ -171,7 +168,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPostProcessHookReturnsEmptyArray()
+    public function getDataStructureIdentifierThrowsExceptionIfPostProcessHookReturnsEmptyArray(): void
     {
         $fieldTca = [
             'config' => [
@@ -191,7 +188,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierPostProcessHookCanEnrichIdentifier()
+    public function getDataStructureIdentifierPostProcessHookCanEnrichIdentifier(): void
     {
         $fieldTca = [
             'config' => [
@@ -210,7 +207,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfDsIsNotAnArrayAndNoDsPointerField()
+    public function getDataStructureIdentifierThrowsExceptionIfDsIsNotAnArrayAndNoDsPointerField(): void
     {
         $fieldTca = [
             'config' => [
@@ -226,7 +223,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsDefaultIfDsIsSetButNoDsPointerField()
+    public function getDataStructureIdentifierReturnsDefaultIfDsIsSetButNoDsPointerField(): void
     {
         $fieldTca = [
             'config' => [
@@ -242,7 +239,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionsIfNoDsPointerFieldIsSetAndDefaultDoesNotExist()
+    public function getDataStructureIdentifierThrowsExceptionsIfNoDsPointerFieldIsSetAndDefaultDoesNotExist(): void
     {
         $fieldTca = [
             'config' => [
@@ -257,7 +254,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldStringHasMoreThanTwoFields()
+    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldStringHasMoreThanTwoFields(): void
     {
         $fieldTca = [
             'config' => [
@@ -273,7 +270,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldWithStringSingleFieldDoesNotExist()
+    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldWithStringSingleFieldDoesNotExist(): void
     {
         $fieldTca = [
             'config' => [
@@ -292,7 +289,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldSWithTwoFieldsFirstDoesNotExist()
+    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldSWithTwoFieldsFirstDoesNotExist(): void
     {
         $fieldTca = [
             'config' => [
@@ -311,7 +308,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldSWithTwoFieldsSecondDoesNotExist()
+    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldSWithTwoFieldsSecondDoesNotExist(): void
     {
         $fieldTca = [
             'config' => [
@@ -330,7 +327,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsPointerFieldValueIfDataStructureExists()
+    public function getDataStructureIdentifierReturnsPointerFieldValueIfDataStructureExists(): void
     {
         $fieldTca = [
             'config' => [
@@ -350,7 +347,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsDefaultIfPointerFieldValueDoesNotExist()
+    public function getDataStructureIdentifierReturnsDefaultIfPointerFieldValueDoesNotExist(): void
     {
         $fieldTca = [
             'config' => [
@@ -370,7 +367,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldValueDoesNotExistAndDefaultToo()
+    public function getDataStructureIdentifierThrowsExceptionIfPointerFieldValueDoesNotExistAndDefaultToo(): void
     {
         $fieldTca = [
             'config' => [
@@ -381,6 +378,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             ],
         ];
         $row = [
+            'uid' => 23,
             'aField' => 'aNotDefinedDataStructure',
         ];
         $this->expectException(InvalidSinglePointerFieldException::class);
@@ -391,7 +389,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * Data provider for getDataStructureIdentifierReturnsValidNameForTwoFieldCombinations
      */
-    public function getDataStructureIdentifierReturnsValidNameForTwoFieldCombinationsDataProvider()
+    public function getDataStructureIdentifierReturnsValidNameForTwoFieldCombinationsDataProvider(): array
     {
         return [
             'direct match of two fields' => [
@@ -491,7 +489,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
      * @param array $ds
      * @param $expected
      */
-    public function getDataStructureIdentifierReturnsValidNameForTwoFieldCombinations(array $row, array $ds, string $expected)
+    public function getDataStructureIdentifierReturnsValidNameForTwoFieldCombinations(array $row, array $ds, string $expected): void
     {
         $fieldTca = [
             'config' => [
@@ -505,7 +503,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionForTwoFieldsWithNoMatchAndNoDefault()
+    public function getDataStructureIdentifierThrowsExceptionForTwoFieldsWithNoMatchAndNoDefault(): void
     {
         $fieldTca = [
             'config' => [
@@ -516,6 +514,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             ],
         ];
         $row = [
+            'uid' => 23,
             'firstField' => 'noMatch',
             'secondField' => 'noMatchToo',
         ];
@@ -527,7 +526,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfParentRowLookupFails()
+    public function getDataStructureIdentifierThrowsExceptionIfParentRowLookupFails(): void
     {
         $fieldTca = [
             'config' => [
@@ -536,6 +535,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             ]
         ];
         $row = [
+            'uid' => 23,
             'pid' => 42,
             'tx_templavoila_ds' => null,
         ];
@@ -575,8 +575,10 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfParentRowsFormALoop()
+    public function getDataStructureIdentifierThrowsExceptionIfParentRowsFormALoop(): void
     {
+        $GLOBALS['BE_USER'] = new BackendUserAuthentication();
+
         $fieldTca = [
             'config' => [
                 'ds_pointerField' => 'tx_templavoila_ds',
@@ -642,8 +644,10 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfNoValidPointerFoundUntilRoot()
+    public function getDataStructureIdentifierThrowsExceptionIfNoValidPointerFoundUntilRoot(): void
     {
+        $GLOBALS['BE_USER'] = new BackendUserAuthentication();
+
         $fieldTca = [
             'config' => [
                 'ds_pointerField' => 'tx_templavoila_ds',
@@ -709,7 +713,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfNoValidPointerValueFound()
+    public function getDataStructureIdentifierThrowsExceptionIfNoValidPointerValueFound(): void
     {
         $fieldTca = [
             'config' => [
@@ -727,7 +731,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfResorvedPointerValueIsIntegerButDsFieldNameIsNotConfigured()
+    public function getDataStructureIdentifierThrowsExceptionIfResorvedPointerValueIsIntegerButDsFieldNameIsNotConfigured(): void
     {
         $fieldTca = [
             'config' => [
@@ -745,7 +749,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierThrowsExceptionIfDsTableFieldIsMisconfigured()
+    public function getDataStructureIdentifierThrowsExceptionIfDsTableFieldIsMisconfigured(): void
     {
         $fieldTca = [
             'config' => [
@@ -764,7 +768,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsValidIdentifierForPointerField()
+    public function getDataStructureIdentifierReturnsValidIdentifierForPointerField(): void
     {
         $fieldTca = [
             'config' => [
@@ -782,8 +786,10 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsValidIdentifierForParentLookup()
+    public function getDataStructureIdentifierReturnsValidIdentifierForParentLookup(): void
     {
+        $GLOBALS['BE_USER'] = new BackendUserAuthentication();
+
         $fieldTca = [
             'config' => [
                 'ds_pointerField' => 'tx_templavoila_ds',
@@ -848,8 +854,10 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsValidIdentifierForParentLookupAndBreaksLoop()
+    public function getDataStructureIdentifierReturnsValidIdentifierForParentLookupAndBreaksLoop(): void
     {
+        $GLOBALS['BE_USER'] = new BackendUserAuthentication();
+
         $fieldTca = [
             'config' => [
                 'ds_pointerField' => 'tx_templavoila_ds',
@@ -905,8 +913,10 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsValidIdentifierForParentLookupAndPrefersSubField()
+    public function getDataStructureIdentifierReturnsValidIdentifierForParentLookupAndPrefersSubField(): void
     {
+        $GLOBALS['BE_USER'] = new BackendUserAuthentication();
+
         $fieldTca = [
             'config' => [
                 'ds_pointerField' => 'tx_templavoila_ds',
@@ -966,7 +976,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsValidIdentifierForTableAndFieldPointer()
+    public function getDataStructureIdentifierReturnsValidIdentifierForTableAndFieldPointer(): void
     {
         $fieldTca = [
             'config' => [
@@ -986,8 +996,10 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function getDataStructureIdentifierReturnsValidIdentifierForTableAndFieldPointerWithParentLookup()
+    public function getDataStructureIdentifierReturnsValidIdentifierForTableAndFieldPointerWithParentLookup(): void
     {
+        $GLOBALS['BE_USER'] = new BackendUserAuthentication();
+
         $fieldTca = [
             'config' => [
                 'ds_pointerField' => 'tx_templavoila_ds',
@@ -1048,7 +1060,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionWithEmptyString()
+    public function parseDataStructureByIdentifierThrowsExceptionWithEmptyString(): void
     {
         $this->expectException(InvalidIdentifierException::class);
         $this->expectExceptionCode(1478100828);
@@ -1058,7 +1070,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierIfIdentifierDoesNotResolveToArray()
+    public function parseDataStructureByIdentifierIfIdentifierDoesNotResolveToArray(): void
     {
         $this->expectException(\RuntimeException::class);
         $this->expectExceptionCode(1478345642);
@@ -1068,7 +1080,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierCallsRegisteredHook()
+    public function parseDataStructureByIdentifierCallsRegisteredHook(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureParsePreProcessHookThrowException::class,
@@ -1081,7 +1093,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionIfHookReturnsNoString()
+    public function parseDataStructureByIdentifierThrowsExceptionIfHookReturnsNoString(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureParsePreProcessHookReturnObject::class
@@ -1094,7 +1106,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierUsesCasualLogicIfHookReturnsNoIdentifier()
+    public function parseDataStructureByIdentifierUsesCasualLogicIfHookReturnsNoIdentifier(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureParsePreProcessHookReturnEmptyString::class
@@ -1114,7 +1126,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierParsesDataStructureReturnedByHook()
+    public function parseDataStructureByIdentifierParsesDataStructureReturnedByHook(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureParsePreProcessHookReturnString::class
@@ -1129,7 +1141,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierParsesDataStructureFromFirstMatchingHook()
+    public function parseDataStructureByIdentifierParsesDataStructureFromFirstMatchingHook(): void
     {
         $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][FlexFormTools::class]['flexParsing'] = [
             DataStructureParsePreProcessHookReturnEmptyString::class,
@@ -1146,7 +1158,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionForInvalidSyntax()
+    public function parseDataStructureByIdentifierThrowsExceptionForInvalidSyntax(): void
     {
         $this->expectException(InvalidIdentifierException::class);
         $this->expectExceptionCode(1478104554);
@@ -1156,7 +1168,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionForIncompleteTcaSyntax()
+    public function parseDataStructureByIdentifierThrowsExceptionForIncompleteTcaSyntax(): void
     {
         $this->expectException(\RuntimeException::class);
         $this->expectExceptionCode(1478113471);
@@ -1167,7 +1179,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionForInvalidTcaSyntaxPointer()
+    public function parseDataStructureByIdentifierThrowsExceptionForInvalidTcaSyntaxPointer(): void
     {
         $this->expectException(InvalidIdentifierException::class);
         $this->expectExceptionCode(1478105491);
@@ -1178,7 +1190,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierResolvesTcaSyntaxPointer()
+    public function parseDataStructureByIdentifierResolvesTcaSyntaxPointer(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1195,7 +1207,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionForIncompleteRecordSyntax()
+    public function parseDataStructureByIdentifierThrowsExceptionForIncompleteRecordSyntax(): void
     {
         $this->expectException(\RuntimeException::class);
         $this->expectExceptionCode(1478113873);
@@ -1206,7 +1218,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierResolvesRecordSyntaxPointer()
+    public function parseDataStructureByIdentifierResolvesRecordSyntaxPointer(): void
     {
         // Prophecies and revelations for a lot of the database stack classes
         $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
@@ -1247,7 +1259,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionIfDataStructureFileDoesNotExist()
+    public function parseDataStructureByIdentifierThrowsExceptionIfDataStructureFileDoesNotExist(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default']
             = 'FILE:EXT:core/Does/Not/Exist.xml';
@@ -1260,7 +1272,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierFetchesFromFile()
+    public function parseDataStructureByIdentifierFetchesFromFile(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default']
             = ' FILE:EXT:core/Tests/Unit/Configuration/FlexForm/Fixtures/DataStructureWithSheet.xml ';
@@ -1293,7 +1305,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionForInvalidXmlStructure()
+    public function parseDataStructureByIdentifierThrowsExceptionForInvalidXmlStructure(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1311,7 +1323,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionIfStructureHasBothSheetAndRoot()
+    public function parseDataStructureByIdentifierThrowsExceptionIfStructureHasBothSheetAndRoot(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1328,7 +1340,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierCreatesDefaultSheet()
+    public function parseDataStructureByIdentifierCreatesDefaultSheet(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1379,7 +1391,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierResolvesExtReferenceForSingleSheets()
+    public function parseDataStructureByIdentifierResolvesExtReferenceForSingleSheets(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1419,7 +1431,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierResolvesExtReferenceForSingleSheetsWithFilePrefix()
+    public function parseDataStructureByIdentifierResolvesExtReferenceForSingleSheetsWithFilePrefix(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1459,7 +1471,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierCallsPostProcessHook()
+    public function parseDataStructureByIdentifierCallsPostProcessHook(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1478,7 +1490,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierThrowsExceptionIfPostProcessHookReturnsNoArray()
+    public function parseDataStructureByIdentifierThrowsExceptionIfPostProcessHookReturnsNoArray(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1497,7 +1509,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function parseDataStructureByIdentifierPostProcessHookManipulatesDataStructure()
+    public function parseDataStructureByIdentifierPostProcessHookManipulatesDataStructure(): void
     {
         $GLOBALS['TCA']['aTableName']['columns']['aFieldName']['config']['ds']['default'] = '
             <T3DataStructure>
@@ -1519,7 +1531,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function traverseFlexFormXmlDataRecurseDoesNotFailOnNotExistingField()
+    public function traverseFlexFormXmlDataRecurseDoesNotFailOnNotExistingField(): void
     {
         $dataStruct = [
             'dummy_field' => [
@@ -1532,7 +1544,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
             'vKeys' => ['ES'],
             'callBackMethod_value' => 'dummy',
         ];
-        $editData = '';
+        $editData = [];
         /** @var \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools|\PHPUnit_Framework_MockObject_MockObject $subject */
         $subject = $this->getMockBuilder(FlexFormTools::class)
             ->setMethods(['executeCallBackMethod'])
@@ -1544,7 +1556,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     /**
      * @test
      */
-    public function traverseFlexFormXmlDataRecurseDoesNotFailOnNotExistingArrayField()
+    public function traverseFlexFormXmlDataRecurseDoesNotFailOnNotExistingArrayField(): void
     {
         $dataStruct = [
             'dummy_field' => [
@@ -1561,7 +1573,7 @@ class FlexFormToolsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
                 'el' => 'dummy',
             ],
         ];
-        $editData2 = '';
+        $editData2 = [];
         /** @var \TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools|\PHPUnit_Framework_MockObject_MockObject $subject */
         $subject = $this->createMock(FlexFormTools::class);
         $this->assertEquals(