mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
Add test for newer ICU version
This commit is contained in:
parent
e02c41fc72
commit
2198d38cbc
1 changed files with 50 additions and 0 deletions
50
ext/intl/tests/formatter_get_locale_variant3.phpt
Normal file
50
ext/intl/tests/formatter_get_locale_variant3.phpt
Normal file
|
@ -0,0 +1,50 @@
|
|||
--TEST--
|
||||
numfmt_get_locale()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '58.1') < 0) die('skip for ICU >= 58.1'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get locale.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$locales = array(
|
||||
'en_UK',
|
||||
'en_US',
|
||||
'fr_CA',
|
||||
);
|
||||
|
||||
$loc_types = array(
|
||||
Locale::ACTUAL_LOCALE => 'actual',
|
||||
Locale::VALID_LOCALE => 'valid',
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL );
|
||||
$res_str .= "$locale: ";
|
||||
foreach( $loc_types as $loc_type => $loc_type_name )
|
||||
$res_str .= sprintf( " %s=%s",
|
||||
$loc_type_name,
|
||||
dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) );
|
||||
$res_str .= "\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
en_UK: actual='en' valid='en'
|
||||
en_US: actual='en' valid='en_US'
|
||||
fr_CA: actual='fr' valid='fr_CA'
|
Loading…
Add table
Add a link
Reference in a new issue