Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! Restore locales before calling assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Mar 15, 2021
1 parent 7748539 commit 9eafbd0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/Zend/Validate/FloatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ public function testPhpLocaleDeFloatType()
*/
public function testPhpLocaleFrFloatType()
{
$locale = setlocale(LC_ALL, 'fr');
$locale = setlocale(LC_ALL, 0);
setlocale(LC_ALL, 'fr');
$valid = new Zend_Validate_Float();
$isValid = $valid->isValid(10.5);
setlocale(LC_ALL, $locale);
Expand All @@ -197,8 +198,10 @@ public function testPhpLocaleFrFloatType()
*/
public function testPhpLocaleDeStringType()
{
$lcAll = setlocale(LC_ALL, 'de_AT');
$lcNumeric = setlocale(LC_NUMERIC, 'de_AT');
$lcAll = setlocale(LC_ALL, 0);
setlocale(LC_ALL, 'de_AT');
$lcNumeric = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, 'de_AT');
$valid = new Zend_Validate_Float('de_AT');
$isValid0 = $valid->isValid('1,3');
$isValid1 = $valid->isValid('1000,3');
Expand Down

0 comments on commit 9eafbd0

Please sign in to comment.