php-src/ext/intl/tests/bug67052.phpt
Ferenc Kovacs 395ef4efb7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixup, both catched by nikic
  use another character device in this test as /dev/console seems that it is different for lxc containers
  the de_DE(iso-8859-1) locale is not available on ubuntu by default, but there is no reason to require that over the utf-8 one
  let's try running our testsuite without sudo
2015-10-19 22:47:23 +02:00

36 lines
740 B
PHP

--TEST--
Bug #67052 - NumberFormatter::parse() resets LC_NUMERIC setting
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die("skip Valid only on non Windows");
}
$l = setlocale(LC_ALL, 'de_DE');
if($l === false) {
die("skip de_DE locale not installed");
}
setlocale(LC_ALL, $l);
?>
--FILE--
<?php
function ut_main()
{
setlocale(LC_ALL, 'de_DE.UTF-8');
$fmt = new NumberFormatter( 'sl_SI.UTF-8', NumberFormatter::DECIMAL);
$num = "1.234.567,891";
$res_str = $fmt->parse($num)."\n";
$res_str .= setlocale(LC_NUMERIC, 0);
return $res_str;
}
include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECT--
1234567,891
de_DE.UTF-8