summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-10-20 19:02:42 +0200
committerAnatol Belski <ab@php.net>2017-10-20 19:02:42 +0200
commit2198d38cbc12beeaf00be688cf33a5a6697ea20c (patch)
tree577a39a4b914390f9336ba86eaf3a7186dd198c5
parente02c41fc72d36033f89c2ad02614c1e9744c1d10 (diff)
downloadphp-git-2198d38cbc12beeaf00be688cf33a5a6697ea20c.tar.gz
Add test for newer ICU version
-rw-r--r--ext/intl/tests/formatter_get_locale_variant3.phpt50
1 files changed, 50 insertions, 0 deletions
diff --git a/ext/intl/tests/formatter_get_locale_variant3.phpt b/ext/intl/tests/formatter_get_locale_variant3.phpt
new file mode 100644
index 0000000000..901e2353b4
--- /dev/null
+++ b/ext/intl/tests/formatter_get_locale_variant3.phpt
@@ -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'