Skip to content
Snippets Groups Projects
Commit 84e1fc32 authored by Christian Kuhn's avatar Christian Kuhn Committed by Morton Jonuschat
Browse files

[BUGFIX] Get current locale without changing environment

Two tests in ext:form change the environment when they try to
back up the current locale:
setlocale(LC_NUMERIC, null): "the locale names will be set from
the values of environment variables", should be
setlocale(LC_NUMERIC, 0): "the locale setting is not affected,
only the current setting is returned"
In my case my default LC_NUMERIC is "C" and after call with 'null'
it is set to and returns 'de_DE.utf8', so it changes the internal
state to something else than before and the reset from backup does
not work properly. This leads to hard to debug problems if other
locale depending tests are executed later.
As a fun fact, phpunit suffers from the same issue and its
api method "setlocale()" that should take care of proper reset
messes this up, too. A pull request is pending to fix that.

The patch fixes the affected unit tests and cleans them up
along the way. Another patch to improve the overall situation
regarding locale handling in unit tests will follow later.

Change-Id: I2295b46cc6934a48e4d71ef5170deb83fb9264b6
Resolves: #76389
Releases: master
Reviewed-on: https://review.typo3.org/48416


Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
parent 6f7b033b
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment