php-src/ext/intl/tests/locale_get_default.phpt
2008-07-07 22:51:04 +00:00

47 lines
853 B
PHP
Executable File

--TEST--
locale_get_default()
--INI--
intl.default_locale=en-US
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
/*
* Try getting the default Locale with different locales
* with Procedural and Object methods.
*/
function ut_main()
{
$res_str = '';
$lang = ut_loc_get_default() ;
$res_str .= "Default locale: $lang";
$res_str .= "\n";
locale_set_default('de-DE');
$lang = ut_loc_get_default() ;
$res_str .= "Default locale: $lang";
$res_str .= "\n";
ini_set('intl.default_locale', 'fr');
$lang = ut_loc_get_default() ;
$res_str .= "Default locale: $lang";
$res_str .= "\n";
ini_restore("intl.default_locale");
return $res_str;
}
include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECT--
Default locale: en-US
Default locale: de-DE
Default locale: fr