[BUGFIX] Implicit constant to string cast in unit test case 05/54905/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:19 +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/54905
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 7f0f83d..120dc3d 100644 (file)
@@ -518,9 +518,9 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $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
@@ -563,7 +563,7 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $validAdditionalFactoryConfigurationFileContent =
             '<?php' . LF .
                 'return [' . LF .
-                    $uniqueContentString . ' => foo,' . LF .
+                    '\'' . $uniqueContentString . '\' => \'foo\',' . LF .
                 '];' . LF;
         file_put_contents(
             $additionalFactoryConfigurationAbsoluteFile,