[BUGFIX] Fix typo and improve backup of system settings
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 6 Feb 2013 20:03:01 +0000 (21:03 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 6 Feb 2013 20:07:35 +0000 (21:07 +0100)
LC_MONETARY was saved to LC_TIME, this needs to be fixed.

Instead of using the constants as is, use the API function to save
and restore system settings.

Fixes: #45218
Releases: 4.5, 4.6, 4.7, 6.0, 6.1
Change-Id: I3c3c9d552d89d69c3689e60dc00e392067b98464
Reviewed-on: https://review.typo3.org/18073
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/fluid/Tests/Unit/ViewHelpers/Form/SelectViewHelperTest.php

index a65818a..6b11e37 100644 (file)
@@ -33,10 +33,10 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
                parent::setUp();
                // Store all locale categories manipulated in tests for reconstruction in tearDown
                $this->backupLocales = array(
-                       LC_COLLATE => setlocale(LC_COLLATE, 0),
-                       LC_CTYPE => setlocale(LC_CTYPE, 0),
-                       LC_MONETARY => setlocale(LC_MONETARY, 0),
-                       LC_TIME => setlocale(LC_MONETARY, 0),
+                       'LC_COLLATE' => setlocale(LC_COLLATE, 0),
+                       'LC_CTYPE' => setlocale(LC_CTYPE, 0),
+                       'LC_MONETARY' => setlocale(LC_MONETARY, 0),
+                       'LC_TIME' => setlocale(LC_TIME, 0),
                );
                $this->arguments['name'] = '';
                $this->arguments['sortByOptionLabel'] = FALSE;
@@ -45,7 +45,7 @@ class SelectViewHelperTest extends \TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers\Form\
 
        public function tearDown() {
                foreach ($this->backupLocales as $category => $locale) {
-                       setlocale($category, $locale);
+                       setlocale(constant($category), $locale);
                }
        }