[BUGFIX] Implicit constant to string cast in unit test case 03/54903/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 2 Dec 2017 01:24:18 +0000 (02:24 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 2 Dec 2017 01:47:11 +0000 (02:47 +0100)
An array key is not used as string but as constant in
two ConfigurationManager test cases. PHP 7.2 is more
picky about this an throws warnings. Fix by creating
proper strings.

Change-Id: I64def6cf9b5d9df7e150d137929c721558c761d7
Resolves: #83190
Releases: master, 8.7, 7.6
Reviewed-on: https://review.typo3.org/54903
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php

index 8f257d4..9eaf892 100644 (file)
@@ -487,9 +487,9 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
         $uniqueContentString = $this->getUniqueId('string_');
         $validFactoryConfigurationFileContent =
             '<?php' . LF .
-                'return array(' . LF .
-                    $uniqueContentString . ' => foo,' . LF .
-                ');' . LF;
+                'return [' . LF .
+                    '\'' . $uniqueContentString . '\' => \'foo\',' . LF .
+                '];' . LF;
         file_put_contents(
             $factoryConfigurationAbsoluteFile,
             $validFactoryConfigurationFileContent
@@ -532,7 +532,7 @@ class ConfigurationManagerTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
         $validAdditionalFactoryConfigurationFileContent =
             '<?php' . LF .
                 'return [' . LF .
-                    $uniqueContentString . ' => foo,' . LF .
+                    '\'' . $uniqueContentString . '\' => \'foo\',' . LF .
                 '];' . LF;
         file_put_contents(
             $additionalFactoryConfigurationAbsoluteFile,